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
  • Automatic inner-pane detection for fixed application windows
  • 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.4

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.4
File Size Uploaded Provenance Actions
scrollweave-0.9.4.tar.gz 198.5 kB With provenance Details for scrollweave-0.9.4.tar.gz

Built distributions (wheels)

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

Total release size: 1.2 MB

Release files / scrollweave-0.9.4.tar.gz

Download URL scrollweave-0.9.4.tar.gz
Size 198.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6a83942e6b32f2f68d36363495eb13c9fe5990f88674be0adf3a84a41d9ca0b0
BLAKE2b-256 checksum
How to use checksums
22cbae025d43c2da1b82612825532b1b1d176290afb524e2c14943d3db114996
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.4-py3-none-win_amd64.whl

Download URL scrollweave-0.9.4-py3-none-win_amd64.whl
Size 265.8 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
d19e3447a25c0d25c128b143ec009fd497a5f10fc97c67347c6e501ea2267b13
BLAKE2b-256 checksum
How to use checksums
6b3807ab5a958654610dcdefb5b5475d7cebd2cf5331be5d01e23457077dac1c
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.4-py3-none-manylinux_2_34_x86_64.whl

Download URL scrollweave-0.9.4-py3-none-manylinux_2_34_x86_64.whl
Size 391.5 kB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
9e112259a369987eacbf57d61edc5f4d56e61b54ecec0b0a95f8339efdfa18e8
BLAKE2b-256 checksum
How to use checksums
a545d97432785874e24632b327acb29706652eda07b6e8c48925b9c40a421ec2
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.4-py3-none-macosx_10_13_universal2.whl

Download URL scrollweave-0.9.4-py3-none-macosx_10_13_universal2.whl
Size 339.7 kB
Tags Python 3 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
548ac4cb1fb2eafb344cf49ca57385c3d83e42bf8a4da0fe8401c1328407b7dd
BLAKE2b-256 checksum
How to use checksums
8b8b9ae22fc5dbcb49139bd7ab77a5bd6028f4ecfc655d6ed77500eecbb391b2
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.4

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.4.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