pil image resize save code example
Example 1: pil resize image
im = Image.open('image.jpg')
im = im.resize((w, h))
Example 2: pyhton image resize
from PIL import Image
from resizeimage import resizeimage
with open('test-image.jpeg', 'r+b') as f:
with Image.open(f) as image:
cover = resizeimage.resize_cover(image, [200, 100])
cover.save('test-image-cover.jpeg', image.format)