Research breakthrough possible @S-Logix

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • +91- 81240 01111

Social List

Image processing with pillow?


To write a piece of python code for image processing with the help of pillow library in python.


PNG Image.


  Gray_scale image

  Blurred version of original image.


  Load the image source.

  Import pillow library.

  Convert the image into gray_scale image.

  Make the image blurred using pillow filter.

  Save both the images.

Sample Code

#import pillow library
from PIL import Image, ImageFilter

#load image
image =‘ml_map.png’)

#The file format of the source file
print(“Image format\n”,image.format,”\n”)

#The pixel format used by the image
print(“Image mode\n”,image.mode,”\n”)

#Image size, in pixels
print(“Image size\n”,image.size,”\n”)

#Convert original into gray_scale image
greyscale_image = image.convert(‘L’)

#Show the grayscale image

#save the gray_scale image“gray_scale.png”)

#Blur the image
blurred = image.filter(ImageFilter.BLUR)

#Display blurred images

#save the new image“blurred.png”)

Image size, in pixels
Image processing with pillow
Image processing with pillow
Show the grayscale image