Skip to main content

ScrollWeave

Stitch scrolling screenshots into a clean page. Python API, Rust core, no third-party runtime dependencies.

PyPI CI License: MIT

ScrollWeave reconstructs a long page from overlapping screenshots. It estimates the scroll motion, detects persistent browser chrome such as fixed headers and sidebars, and copies the original image pixels into the output. No image content is generated.

Features

  • Layered reconstruction of vertically scrolling pages
  • Automatic fixed-header/sidebar detection
  • Automatic small horizontal capture-drift correction
  • Multi-band 2D gradient NCC with graph consensus for automatic offsets
  • Optional Viewport for explicit content regions
  • Basic 2D alignment and compositing
  • PNG, BMP and PPM support
  • Python standard library only at runtime; no NumPy, Pillow or SciPy
  • Rust core with no third-party crates

Install

python -m pip install scrollweave

Prebuilt wheels are available for Linux, Windows and macOS. On a platform without a wheel, pip builds the source distribution and needs Rust/Cargo and a linker.

To install a checkout:

python -m pip install .

Quick start

from scrollweave import stitch_layered

result = stitch_layered(['top.png', 'middle.png', 'bottom.png'])
result.save('page.png')

Scroll positions are optional and are estimated when omitted. If the screenshots contain lots of blank space, repeated patterns or heavy occlusion, pass the positions explicitly:

result = stitch_layered(
    ['top.png', 'middle.png', 'bottom.png'],
    scroll=[0, 640, 1280],
)

To crop a known content region, pass a Viewport:

from scrollweave import Viewport

result = stitch_layered(
    ['top.png', 'bottom.png'],
    scroll=[625, 0],
    viewport=Viewport(top=75, bottom=1035, left=357, right=1910),
)

Viewport uses source-frame coordinates; bottom and right are exclusive. If a viewport is omitted, ScrollWeave tries to detect fixed chrome and infer the content region automatically.

Python API

The main operations are:

from scrollweave import (
    Image,
    LayeredOptions,
    PlanOptions,
    Viewport,
    compose,
    plan_views,
    stitch_basic,
    stitch_layered,
)

# Layered reconstruction
result = stitch_layered(images_or_paths, scroll=[0, 640, 1280])

# Basic 2D alignment/compositing
basic = stitch_basic(images_or_paths, positions=[0, 640])

# Layout without alignment
combined = compose(images_or_paths, layout='vertical', gap=8)

# Recommend additional views from an existing layered result
suggestions = plan_views(result, PlanOptions(count=2))

stitch_layered returns LayeredResult with the output image, scroll positions, viewport, evidence maps and optional diagnostics. Image accepts raw RGB bytes:

frame = Image(width=32, height=32, rgb=b'\xff\x00\x00' * (32 * 32))

See docs/ARCHITECTURE.md for the processing pipeline and docs/PORT_STATUS.md for the current implementation status.

CLI

# Reconstruct a page; positions are estimated when omitted
scrollweave stitch shot-*.png -o page.png

# Explicit positions and an explicit content band
scrollweave stitch shot-*.png -o page.png --positions 0,640,1280 --viewport 75:1035

# Basic matcher
scrollweave stitch shot-*.png -o page.png --algorithm basic

# Compose images without alignment
scrollweave compose a.png b.png -o combined.png --layout horizontal

The Python module is also runnable directly with python -m scrollweave.

Errors

ScrollWeave raises specific exception types instead of passing raw OS or C error strings through to callers:

from scrollweave import Image, ImageFormatError, ImageIOError, InvalidArgumentError

try:
    Image.open('missing.png')
except ImageIOError as exc:
    print(exc)  # includes the path and a human-readable reason

The exception hierarchy is:

Exception Meaning
InvalidArgumentError Invalid or inconsistent API arguments (ValueError)
LimitError A size/count/allocation limit was exceeded (ValueError)
UnsupportedFormatError Unsupported image or output format (ValueError)
ImageIOError File could not be opened, created or written (OSError)
ImageFormatError Image bytes are corrupt or malformed (ValueError)
NativeError General native-engine failure (RuntimeError)
NativeUnavailable Native library is missing or has an ABI mismatch (RuntimeError)
InternalError Unexpected native panic or invariant failure (RuntimeError)

All of these inherit from ScrollWeaveError.

Limitations

  • Layered reconstruction handles vertical scrolling and same-sized frames. Use stitch_basic for arbitrary 2D positions.
  • Input formats are PNG, BMP and PPM; JPEG, HEIC and video are not supported.
  • OCR, semantic segmentation and learned UI detection are not included.
  • Automatic scroll estimation can be ambiguous on blank or periodic pages; explicit positions are the reliable option there.
  • Output pixels are copied from input frames; missing content is not invented.

Development

cargo test --workspace --all-targets
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
python -m unittest discover -s tests/python
python -m ruff format --check .
python -m ruff check .

research/reference/ contains a frozen Python research reference used for future parity work. It is not imported or installed by the package.

License

MIT

Metadata

Release files for scrollweave 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrollweave 0.9.3
File Size Uploaded Provenance Actions
scrollweave-0.9.3.tar.gz 197.1 kB With provenance Details for scrollweave-0.9.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for scrollweave 0.9.3
File Interpreter ABI Platform Actions
scrollweave-0.9.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for scrollweave-0.9.3-py3-none-win_amd64.whl
scrollweave-0.9.3-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details for scrollweave-0.9.3-py3-none-manylinux_2_34_x86_64.whl
scrollweave-0.9.3-py3-none-macosx_10_13_universal2.whl Python 3 none macOS 10.13+ universal2 (ARM64, x86-64) Details for scrollweave-0.9.3-py3-none-macosx_10_13_universal2.whl

Total release size: 1.2 MB

Release files / scrollweave-0.9.3.tar.gz

Download URL scrollweave-0.9.3.tar.gz
Size 197.1 kB
Tags Source
SHA-256 checksum
How to use checksums
63b89cc621d301dc363e577a2ef93031fce0bef0eb3c5d15d27db306469ef21d
BLAKE2b-256 checksum
How to use checksums
b1b363869c737a5bda0887abe17dc9eee59295de889201f9ab6aa5cb4f591176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / scrollweave-0.9.3-py3-none-win_amd64.whl

Download URL scrollweave-0.9.3-py3-none-win_amd64.whl
Size 264.8 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
1944701a8a9bcabac5e359203fd48bb0db1332b5ca4c444d267363d67ad01431
BLAKE2b-256 checksum
How to use checksums
ffa4e7c00a74c10bc06d53043c137a8eda5806a435d2e7219409490d56aa2036
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / scrollweave-0.9.3-py3-none-manylinux_2_34_x86_64.whl

Download URL scrollweave-0.9.3-py3-none-manylinux_2_34_x86_64.whl
Size 390.5 kB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5fc925e182ebe71cdb08455e1d8f6d65d7c08e74fea1ef2136472f242b8a97d1
BLAKE2b-256 checksum
How to use checksums
c3ddaf4eb489706bc964248762b3ea58ecb0204c1f1bbe17e38ecb3e053d7898
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / scrollweave-0.9.3-py3-none-macosx_10_13_universal2.whl

Download URL scrollweave-0.9.3-py3-none-macosx_10_13_universal2.whl
Size 338.7 kB
Tags Python 3 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
8d60efbbfae04bfd224d0f6dfd34d61038b1b605e3551a66c918a1d0d80a606b
BLAKE2b-256 checksum
How to use checksums
2bbfd2ccada854558aed375b8267224b0587e915378d9f8f8eba4ced2da180cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for scrollweave 0.9.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for scrollweave-0.9.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page