Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.