FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Image_Filters_Python/Kernal_Filter_An_Image.py at main · ibelgin/Image_Filters_Python · GitHub
ibelgin
/
Image_Filters_Python
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
6
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Image_Filters_Python
/
Kernal_Filter_An_Image.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
15 lines (11 loc) · 731 Bytes
Breadcrumbs
Image_Filters_Python
/
Kernal_Filter_An_Image.py
Copy path
File metadata and controls
15 lines (11 loc) · 731 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Parameters:
# size – Kernel size, given as (width, height). In the current version, this must be (3, 3) or (5, 5).
# kernel – A sequence containing kernel weights.
# scale – Scale factor. If given, the result for each pixel is divided by this value. the default is the sum of the kernel weights.
# offset – Offset. If given, this value is added to the result, after it has been divided by the scale factor.
from
PIL
import
Image
,
ImageFilter
# creating a image object
orginal
=
Image
.
open
(
r"C:\Users\Belgin\Desktop\github.png"
)
# applying the Kernel filter
kernal
=
orginal
.
filter
(
ImageFilter
.
Kernel
((
3
,
3
), (
-
1
,
-
1
,
-
1
,
-
1
,
11
,
-
2
,
-
2
,
-
2
,
-
2
),
1
,
0
))
kernal
=
kernal
.
show
()
Back
|
FazBrowse Home
|
New Git URL