π§© Seamlessly stitch multiple scrolling screenshots into a single image.
A simple yet powerful tool for combining sequential screenshots captured from scrolling content. Perfect for creating long screenshots of web pages, chat conversations, documents, and more.
- π Automatic Overlap Detection - Uses ORB feature matching to find and align overlapping regions
βοΈ Vertical Stitching - For up/down scrolling content (default)βοΈ Horizontal Stitching - For left/right scrolling content- π― Smart Alignment - Corrects minor horizontal/vertical misalignment between images
- βοΈ Auto Cropping - Trims output to the common region across all images
- Python 3.10+
- opencv-python >= 4.8.0
- numpy >= 1.24.0
# Clone the repository
git clone https://github.com/yourusername/skill-image-stitch.git
cd skill-image-stitch
# Create virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Stitch images from a folder (vertical, sorted by filename)
python stitch.py -i input/ -o output/result.png
# Horizontal stitching
python stitch.py -i input/ -o output/result.png --horizontal
# Specify individual images
python stitch.py img1.png img2.png img3.png -o result.png| Option | Short | Description |
|---|---|---|
--input |
-i |
Input folder containing images (sorted by filename) |
--output |
-o |
Output file path (default: output/stitched.png) |
--horizontal |
-H |
Use horizontal stitching mode |
--no-detect |
Disable overlap detection (direct concatenation) | |
--debug |
Show detailed matching information |
# Stitch chat screenshots vertically
python stitch.py -i screenshots/chat/ -o chat_full.png
# Stitch panorama images horizontally
python stitch.py -i screenshots/panorama/ -o panorama.png -H
# Debug mode to see matching details
python stitch.py -i input/ -o output.png --debugβββββββββββββββ
β Image 1 β
β β
β ββββββββββββΌβββββββββββ
β β Overlap β β
ββββΌβββββββββββ β
β Image 2 β
β β
β ββββββββββββββββββββΌβββββββββββ
β β Overlap β β
ββββΌβββββββββββββββββββ β
β Image 3 β
β β
βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββ
β β
β Stitched Result β
β β
βββββββββββββββββββββββββββββββ
- π Feature Detection - Extracts ORB keypoints from overlap regions
- π Matching - Finds corresponding points between consecutive images
- π Offset Calculation - Computes overlap amount and alignment shift
- πΌοΈ Stitching - Places images on canvas with calculated offsets
- βοΈ Cropping - Trims to the common visible region
| β Do | β Don't |
|---|---|
| Keep 20%+ overlap between images | Use images with no overlap |
| Maintain similar dimensions | Mix very different sized images |
| Include content-rich overlap areas | Overlap on solid color regions |
| Use consistent scroll direction | Change scroll direction mid-capture |
skill-image-stitch/
βββ π SKILL.md # Skill definition for AI agents
βββ π stitch.py # Main stitching script
βββ π requirements.txt # Python dependencies
βββ π README.md # This file
βββ π input/ # Default input directory
βββ π output/ # Default output directory
- Maximum 10 images per stitch operation
- Requires 20%+ overlap for reliable matching
- May struggle with:
- Pure solid color regions
- Highly repetitive patterns
- Very low resolution images
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenCV for the powerful computer vision library
- ORB (Oriented FAST and Rotated BRIEF) for feature detection
Made with β€οΈ for seamless screenshots