Skip to content

Instantly share code, notes, and snippets.

@iraycd
Last active August 29, 2015 13:56
Show Gist options
  • Save iraycd/9171016 to your computer and use it in GitHub Desktop.
Save iraycd/9171016 to your computer and use it in GitHub Desktop.
Simple script for making square images.
from PIL import Image,ImageOps
import os
dir = os.listdir('./')
size = (300,300) # To the size 300
for i in dir:
image = Image.open(i)
thumb = ImageOps.fit(image, size, Image.ANTIALIAS)
thumb.save(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment