Skip to content

Instantly share code, notes, and snippets.

@charliek
Created February 25, 2010 16:31
Show Gist options
  • Save charliek/314693 to your computer and use it in GitHub Desktop.
Save charliek/314693 to your computer and use it in GitHub Desktop.
import glob
import os.path
import Image
import ImageDraw
import ImageFont
size = 75, 50
for infile in glob.glob("*.png"):
file, ext = os.path.splitext(infile)
im = Image.new("RGB", (248, 182), "#ffffff")
preview = Image.open(infile)
im.paste(preview, (0,0), preview)
im.thumbnail(size, Image.ANTIALIAS)
im.save(file + ".jpg", "JPEG")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment