Skip to content

Commit 589edb9

Browse files
authored
Add files via upload
0 parents  commit 589edb9

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

Diff for: image_background_filter.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from PIL import Image, ImageEnhance, ImageFilter
2+
3+
im = Image.open("image_noise.jpg") #input image
4+
im = im.filter(ImageFilter.MedianFilter())
5+
enhancer = ImageEnhance.Contrast(im)
6+
im = enhancer.enhance(2)
7+
im = im.convert('1')
8+
im.save('image_clear.jpg') #ouput image

Diff for: image_clear.jpg

1.55 KB
Loading

Diff for: image_noise.jpg

3.52 KB
Loading

Diff for: readme.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This code can filter noises from background of an image and converts image to grayscale mode.
2+
Very useful for image Pre-processing
3+
4+
>>Example included
5+
6+
>>Run "image_background_filter.py"

0 commit comments

Comments
 (0)