Merge many screenshots into one long vertical image (similar to a mobile scrolling screenshot).
- Merges images top-to-bottom into one file
- Uses numeric filename order (
1.png,2.png, ...,17.png) - Supports custom input folder, output file, spacing, alignment, and background color
- Automatically uses
images_inputas default input folder when it exists
- Python 3.9+
- Pillow
Install dependencies:
pip install -r requirements.txt- Put screenshots in
images_input(or any folder you choose). - Run:
python merge_screenshots.pyDefault output: combined_screenshot.png
merge-multiple-screenshots/
merge_screenshots.py
requirements.txt
README.md
.gitignore
images_input/ # optional input folder (ignored by git)
python merge_screenshots.py
python merge_screenshots.py --input-dir "images_input" --output "final.png"
python merge_screenshots.py --input-dir "my_shots" --output "merged.png" --gap 10 --align center --bg 255,255,255python3 merge_screenshots.py
python3 merge_screenshots.py --input-dir "images_input" --output "final.png"
python3 merge_screenshots.py --input-dir "my_shots" --output "merged.png" --gap 10 --align center --bg "#ffffff"python merge_screenshots.py --input-dir "images_input" --output "final.png" --gap 0 --align left --bg 255,255,255| Option | Description | Example |
|---|---|---|
--input-dir |
Input folder with screenshots. Default is images_input if present, otherwise current folder. |
--input-dir "images_input" |
--output |
Output file path/name. | --output "merged.png" |
--gap |
Vertical space in pixels between images. | --gap 10 |
--align |
Horizontal alignment for mixed-width images: left, center, right. |
--align center |
--bg |
Background color for empty side space: R,G,B or #RRGGBB. |
--bg 255,255,255 |
--extensions |
File types to include. | --extensions .png .jpg .jpeg |
- If filenames are pure numbers (like
1.png,2.png,10.png), images are merged in numeric order. - For other names, natural sorting is used (for example,
shot2.pngbeforeshot10.png).
Input folder:
images_input/
1.png
2.png
3.png
Run:
python merge_screenshots.py --input-dir "images_input" --output "combined.png"Output:
combined.png
Install dependencies again:
pip install -r requirements.txt- Check your folder path in
--input-dir - Check that files use supported extensions (
.png,.jpg,.jpeg,.webp) - Or pass extensions manually:
python merge_screenshots.py --extensions .png .jpg .jpeg .webp- Reduce screenshot dimensions before merging, or
- Split into smaller groups and create multiple merged outputs
Example:
python merge_screenshots.py --input-dir "my_shots" --output "merged.png" --extensions .png .jpg