Created
November 28, 2012 17:40
-
-
Save carlosefonseca/4162772 to your computer and use it in GitHub Desktop.
Concatenate Two iPhone 5 Images.
This file contains 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
set theScript to quoted form of POSIX path of (path to resource "compositeImages.py" in directory "Scripts") | |
on open these_items | |
set theScript to quoted form of POSIX path of (path to resource "compositeImages.py" in directory "Scripts") | |
set f1 to (quoted form of POSIX path of (first item of these_items)) | |
set f2 to (quoted form of POSIX path of (item 2 of these_items)) | |
choose file name with prompt "Destination:" default name "Images.png" without invisibles | |
set theFile to quoted form of POSIX path of result | |
set s to "/usr/bin/python " & theScript & " " & f1 & " " & f2 & " " & theFile | |
do shell script s | |
end open |
This file contains 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
#!/usr/bin/python | |
import sys | |
from PIL import Image | |
im = Image.new("RGBA", (650,568)) | |
im1 = Image.open(sys.argv[1]).resize((320,568), Image.BILINEAR) | |
im2 = Image.open(sys.argv[2]).resize((320,568), Image.BILINEAR) | |
im.paste(im1, (0,0)) | |
im.paste(im2, (330,0)) | |
im.save(sys.argv[3],"PNG") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment