Skip to content

Instantly share code, notes, and snippets.

@patrickfuller
Created March 30, 2014 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save patrickfuller/9879934 to your computer and use it in GitHub Desktop.
Save patrickfuller/9879934 to your computer and use it in GitHub Desktop.
Combines multiple images of the same size into a composite image.
"""
Combine multiple images of the same size vertically. Usage:
python image_stacker.py path/to/img_1.jpg path/to/img_2.jpg ... img_n.jpg
"""
import sys
from PIL import Image
size = (1920, 1080 * len(sys.argv[1:]))
output = Image.new('RGB', size)
for i, image in enumerate(sys.argv[1:]):
output.paste(Image.open(image), (0, i * 1080))
output.save("output.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment