9951 explained code solutions for 126 technologies

python-pillowHow to create thumbnail

from PIL import Image, ImageDraw, ImageFont

im = Image.open('/var/www/examples/heroine.png')
im.thumbnail((100, 100))

im.show()ctrl + c

import Pillow package modules


open given image with Pillow


creates image thumbnail that fits into given width/height

100, 100

thumbnail width and height


displays resulting image