Skip to content

Instantly share code, notes, and snippets.

@ger-
Created December 2, 2013 16:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ger-/7752095 to your computer and use it in GitHub Desktop.
Save ger-/7752095 to your computer and use it in GitHub Desktop.
Pythonista script to post to Instagram directly from iPhone, a composite of 4 images from camera roll. This is a minor modification to a script from http://macstories.net/.
import clipboard
import Image
import console
import webbrowser
import photos
im1 = clipboard.get_image(idx=0)
im2 = clipboard.get_image(idx=1)
im3 = clipboard.get_image(idx=2)
im4 = clipboard.get_image(idx=3)
background = Image.new('RGBA', (612,612), (255, 255, 255, 255))
console.clear()
print "Generating image..."
console.show_activity()
a=im1.resize((306,306),Image.ANTIALIAS)
b=im2.resize((306,306),Image.ANTIALIAS)
c=im3.resize((306,306),Image.ANTIALIAS)
d=im4.resize((306,306),Image.ANTIALIAS)
background.paste(a,(0,0))
background.paste(b,(306,0))
background.paste(c,(0,306))
background.paste(d,(306,306))
background.show()
console.hide_activity()
photos.save_image(background)
inst='instagram://camera'
webbrowser.open(inst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment