Python Pillow

Pillow is the Python library for image manipulation.

Install

sudo pip3 install pillow

Example code snippets

Resizing an image

import * from PIL

# Resize the oringal image file
im = Image.open(full_filename)
h = 1080
w = round(im.width * 1080 / im.height)
out = im.resize((w, h))
out.save(resized_filename)