Skip to content

About

A simple Python CLI tool to stitch numbered screenshots into one long vertical image with customizable spacing, alignment, and background color.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Merge Multiple Screenshots

Merge many screenshots into one long vertical image (similar to a mobile scrolling screenshot).

Features

  • 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_input as default input folder when it exists

Requirements

  • Python 3.9+
  • Pillow

Install dependencies:

pip install -r requirements.txt

Quick Start

  1. Put screenshots in images_input (or any folder you choose).
  2. Run:
python merge_screenshots.py

Default output: combined_screenshot.png

Project Structure

merge-multiple-screenshots/
  merge_screenshots.py
  requirements.txt
  README.md
  .gitignore
  images_input/        # optional input folder (ignored by git)

Command Examples

Windows (PowerShell)

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,255

macOS / Linux

python3 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"

CLI Usage

python merge_screenshots.py --input-dir "images_input" --output "final.png" --gap 0 --align left --bg 255,255,255

Options

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

Ordering Rules

  • 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.png before shot10.png).

Input -> Output Example

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

Troubleshooting

ModuleNotFoundError: No module named 'PIL'

Install dependencies again:

pip install -r requirements.txt

No images found to merge

  • 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

Output file is very large

  • 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

About

A simple Python CLI tool to stitch numbered screenshots into one long vertical image with customizable spacing, alignment, and background color.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages