Skip to content

Instantly share code, notes, and snippets.

@james-see
Created April 24, 2014 05:07
Show Gist options
  • Save james-see/11242170 to your computer and use it in GitHub Desktop.
Save james-see/11242170 to your computer and use it in GitHub Desktop.
Pythonista Script to Post Non-Square Images to Instagram without cropping
from PIL import Image, ImageOps
import clipboard, photos,webbrowser
im=photos.pick_image()#clipboard.get_image
if im.size[0] >= im.size[1]:
whitespace=((im.size[0]-im.size[1])/2)+250
xbump=250
else:
xbump=((im.size[1]-im.size[0])/2)+250
whitespace=250
matted=ImageOps.expand(im,border=(xbump,whitespace),fill='white')
photos.save_image(matted)
inst='instagram://camera'
webbrowser.open(inst)
#if you have any questions or comments @jamescampbell on twitter
@james-see
Copy link
Author

Works in Pythonista perfectly to get uncropped non-square photos into instagram quicker than Squareready or anything else. Enjoy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment