Applying Gaussian Blur to an image using the Pillow library

In this program, we will blur an image using a Gaussian filter. The ImageFilter class in the pillow library contains a function called GaussianBlur() which helps to apply the gaussian blur filter. It takes only one parameter that is blur radius.

Original Image


Step 1: Import Image and ImageFilter from Pillow.
Step 2: Open the image.
Step 3: Call the gaussianblur() method and specify the radius
Step 4: Display the output.

Example Code

from PIL import Image, ImageFilter

im ='image_test.jpg')
im1 = im.filter(ImageFilter.GaussianBlur(radius = 9))