HOME/Articles/

pil example image resize python (snippet)

Article Outline

Python pil example 'image resize python'

Modules used in program:

  • import PIL

python image resize python

Python pil example: image resize python

#sudo apt-get install image
import PIL
from PIL import Image
width = 300
height=300
img = Image.open(‘fullsized_image.jpg')
img = img.resize(width, height), PIL.Image.ANTIALIAS)
img.save(‘resized_image.jpg')