Saturday, July 4, 2009

resize images to create thumbnails

First you have many images.
If you want to create thumbnail for each one this is python script:

import glob 
import PIL
from PIL import Image
for infile in glob.glob("*.jpg"):
 img =
 img = img.resize((100,dim_size),PIL.Image.ANTIALIAS)
 if infile[0:2] != "trumb_":"trumb_" + infile, "JPEG")

No comments:

Post a Comment