9951 explained code solutions for 126 technologies


python-pillowHow to resize an image


from PIL import Image, ImageDraw, ImageFont

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

im.show()ctrl + c
PIL

import Pillow package modules

Image.open

open given image with Pillow

.resize(

resizes given image to the specified size

100

resized image width

200

resized image height

.show()

displays resulting image