Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79dfcc9

Browse files
author
Soumitra
committed
python blur image pil
1 parent 88f7164 commit 79dfcc9

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

python-blur-image/original.jpg

74.7 KB
Loading
56.5 KB
Loading
44.4 KB
Loading
39.9 KB
Loading
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from PIL import Image, ImageFilter
2+
import os
3+
4+
img_dir = "C:/python/python-blur-image/"
5+
img_name = 'original.jpg'
6+
img = Image.open(img_dir + img_name)
7+
f, e = os.path.splitext(img_dir + img_name)
8+
9+
blur_img = img.filter(ImageFilter.BLUR)
10+
blur_img.save(f + '_blurred.jpg')
11+
12+
box_blur_img = img.filter(ImageFilter.BoxBlur(7))
13+
box_blur_img.save(f + '_box_blurred.jpg')
14+
15+
gaus_blur_img = img.filter(ImageFilter.GaussianBlur(7))
16+
gaus_blur_img.save(f + '_gaus_blurred.jpg')

0 commit comments

Comments
 (0)