Skip to content

Instantly share code, notes, and snippets.

View Argentum4k's full-sized avatar
💭
eboshing

Argentum4k

💭
eboshing
View GitHub Profile
@odyniec
odyniec / gist:3470977
Created August 25, 2012 21:04
Autocropping a transparent image in Python using PIL
#!/usr/bin/env python
import sys
import Image
def autocrop_image(image, border = 0):
# Get the bounding box
bbox = image.getbbox()
# Crop the image to the contents of the bounding box