what is it?

adds image processing capabilities to python interpreter

thumbnail

modifies the image to contain a thumbnail version of itself, no larger than the given size

from io import BytesIO
 
from PIL import Image
 
im = Image.open("/home/image.jpg)
size = (100, 100)
im.thumbnail(size)
 
thumb_io = BytesIO()
im.save(thumb_io, "JPEG")