Skip to content

Instantly share code, notes, and snippets.

@antiface
Forked from patrickfuller/image_stacker.py
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antiface/538493f49f2d65244106 to your computer and use it in GitHub Desktop.
Save antiface/538493f49f2d65244106 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