Skip to content

Instantly share code, notes, and snippets.

@mboldt
Last active August 10, 2016 17:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Python crop and resize image
from PIL import Image
im = Image.open('original.jpg')
imc = im.crop((0, 0, 400, 400))
imr = imc.resize((300, 300), Image.LANCZOS)
imr.save('cropped-and-resized.jpg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment