Python PIL | GaussianBlur() method

PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageFilter module contains definitions for a pre-defined set of filters, which can be used with the Image.filter() method.

PIL.ImageFilter.GaussianBlur() method create Gaussian blur filter.

Syntax: PIL.ImageFilter.GaussianBlur(radius=5)



Parameters:
radius – blur radius. Changing value of radius the different intensity of GaussianBlur image were obtain.

Returns type: An image.

Image Used:

filter_none

edit
close

play_arrow

link
brightness_4
code

   
  
# Importing Image and ImageFilter module from PIL package 
from PIL import Image, ImageFilter 
  
# creating a image object 
im1 = Image.open(r"C:\Users\System-Pc\Desktop\leave.JPG"
  
# applying the Gaussian Blur filter 
im2 = im1.filter(ImageFilter.GaussianBlur(radius = 5))
  
im2.show() 

chevron_right


Output:

radius:radius value used here is 2.

filter_none

edit
close

play_arrow

link
brightness_4
code

Importing Image and ImageFilter module from PIL package 
from PIL import Image, ImageFilter 
  
# creating a image object 
im1 = Image.open(r"C:\Users\System-Pc\Desktop\leave.JPG"
  
# applying the Gaussian Blur filter 
im2 = im1.filter(ImageFilter.GaussianBlur(radius = 2))
  
im2.show() 

chevron_right


Output:



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.