Created
April 24, 2014 05:07
-
-
Save james-see/11242170 to your computer and use it in GitHub Desktop.
Pythonista Script to Post Non-Square Images to Instagram without cropping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works in Pythonista perfectly to get uncropped non-square photos into instagram quicker than Squareready or anything else. Enjoy.