Skip to content

Instantly share code, notes, and snippets.

View alexanderjulo's full-sized avatar

Alexander Jung-Loddenkemper alexanderjulo

View GitHub Profile
@sigilioso
sigilioso / cuter.py
Created June 19, 2012 22:58
Python PIL Example: get a thumbnail by resizing and cropping an image.
# -*- coding: utf-8 -*-
import Image
def resize_and_crop(img_path, modified_path, size, crop_type='top'):
"""
Resize and crop an image to fit the specified size.
args:
img_path: path for the image to resize.