Skip to content

Instantly share code, notes, and snippets.

View ashussen's full-sized avatar

Albert Samuel ashussen

View GitHub Profile
#run this in any directory with the max width parameter add -v for verbose
#image will be scalled in proportion to confine within the max width parameter
#this allows you to get images that are within a box dimension for online publishing (i.e. 400x400) without distorting the image
#get Pillow (fork of PIL) from pip before running --> pip install Pillow
#regarding timing: 42 seconds for 4938 so max 15 minutes for 100,000 images
from __future__ import division