ImageFilter
moduleThe ImageFilter
module in PIL contains definitions for a pre-defined set of filters that are used for different purposes.
GaussianBlur
functionThe Gaussian filter is a type of low-pass filter that reduces high-frequency components. Instead of using the box filter, the image is convolved using a Gaussian filter.
PIL.ImageFilter.GaussianBlur(radius=2)
radius
: This is the blur radius or the standard deviation of the Gaussian kernel. The default value is 2
.With different radius values, we get different blur intensities.
from PIL import Image, ImageFilterimg = Image.open("/code/Memcache.png")img1 = img.filter(ImageFilter.GaussianBlur(radius=50))img1.save('output/graph.png') #Used internally on our platform for calling show(). Ignore if you are implementing locally.img1.show()
ImageFilter
and Image
modules.Memcache.png
into memory using open()
in Image
module.50
to the image we loaded in Line 2.