Welcome folks today in this blog post we will be adding the blur effect
to the input image file using pillow
library in python. All the full source code of the application is shown below.
Get Started
In order to get started you need to make an app.py
file and copy paste the following code
app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#Import required Image library from PIL import Image, ImageFilter #Open existing image OriImage = Image.open('images/boy.jpg') OriImage.show() #Applying GaussianBlur filter gaussImage = OriImage.filter(ImageFilter.GaussianBlur(5)) gaussImage.show() #Save Gaussian Blur Image gaussImage.save('images/gaussian_blur.jpg') |
As you can see we are importing the pillow
library and then we are applying the gaussian blur
to the input image and then we are saving the output image file.