Skip to content

Instantly share code, notes, and snippets.

@mcskrzypczak
Created January 27, 2014 20:55
Show Gist options
  • Save mcskrzypczak/8657136 to your computer and use it in GitHub Desktop.
Save mcskrzypczak/8657136 to your computer and use it in GitHub Desktop.
import clipboard
import Image
import console
im1 = clipboard.get_image(idx=0)
im2 = clipboard.get_image(idx=1)
background = Image.new('RGBA', (1300,1136), (255, 255, 255, 255))
def main():
console.clear()
print "Generating image..."
console.show_activity()
_1 = im1
_2 = im2
background.paste(_1,(0,0))
background.paste(_2,(660,0))
background.show()
console.hide_activity()
clipboard.set_image(background, format='jpeg', jpeg_quality=0.80)
print "\n\n Image set to clipboard"
console.clear()
print "Create now or Control? \n"
print "[1] Create"
print "[2] Control \n"
set_mode = raw_input("Select a mode: ")
if set_mode == "x":
print "Exited"
elif set_mode == "1":
if __name__ == '__main__':
main()
elif set_mode == "2":
print "\n\n"
print "Which image goes on the left? (in Photos.app order) \n"
print "[1] The first image"
print "[2] The second image \n"
set_im = raw_input("Select an image: ")
if set_im == "x":
print "Exited"
else:
print "\n\n"
if set_im == "1":
if __name__ == '__main__':
main()
elif set_im == "2":
console.clear()
print "Generating image..."
console.show_activity()
_1 = im1
_2 = im2
background.paste(_1,(660,0))
background.paste(_2,(0,0))
background.show()
console.hide_activity()
clipboard.set_image((background), format='jpeg', jpeg_quality=0.80)
print "\n\n Image set to clipboard"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment