pillow

Python imaging library for opening, manipulating, and saving images.

brewmacoslinux
Try with needOr install directly
Source

About

Friendly PIL fork (Python Imaging Library)

Examples

resize an image to smaller dimensions$ python3 -c "from PIL import Image; img = Image.open('photo.jpg'); img.resize((800, 600)).save('resized.jpg')"
convert image format from jpg to png$ python3 -c "from PIL import Image; Image.open('image.jpg').convert('RGB').save('image.png')"
crop a specific area from an image$ python3 -c "from PIL import Image; img = Image.open('photo.jpg'); img.crop((100, 100, 400, 400)).save('cropped.jpg')"
rotate an image by a certain number of degrees$ python3 -c "from PIL import Image; Image.open('photo.jpg').rotate(90).save('rotated.jpg')"
apply grayscale filter to an image$ python3 -c "from PIL import Image; Image.open('photo.jpg').convert('L').save('grayscale.jpg')"