Filter out part of an image using PIL, python

I cannot figure out how to apply a blur filter to part of an image using PIL. I tried to do a google search and read the PIL documentation but didn't find anything useful. Thanks for the help.

+4
source share
1 answer

You can cut out a fragment of the image, blur it and paste it back. For instance:

box = (30, 30, 110, 110) ic = image.crop(box) for i in range(10): # with the BLUR filter, you can blur a few times to get the effect you're seeking ic = ic.filter(ImageFilter.BLUR) image.paste(ic, box) 

enter image description here

+14
source

Source: https://habr.com/ru/post/1401361/


All Articles