framesheet
framesheet renders an animated SVG or HTML page at exact, evenly spaced points in virtual time and turns them into images you (or an AI agent) can check at a glance.
An agent can only look at still images, and one screenshot shows one moment. A dot that
sits at (0,0) for the first second, a label that overflows its card, a box that flies
off the canvas halfway through, a loop that jumps back at the end: none of these show up
reliably in a single screenshot. framesheet captures the whole cycle, frame-accurately
and deterministically (same input, same PNG bytes), and adds numbers to back it up.
What you get
For every input, in the output directory:
| File | Use it for |
|---|---|
full.png |
One full-resolution frame (default t=0, --at SECONDS): layout, text, margins. |
sheet.png |
Contact sheet: N frames (default 12) over one cycle, each labelled t=0.50s. The last tile is one 60 fps frame before the cycle end, so you can judge the loop against the first tile. |
heatmap.png |
Motion heatmap: every pixel that changes at any time, coloured over a dimmed first frame. Shows what moves at all, including things that should not. |
report.json |
Detected duration and how it was found, static findings, per-frame changed-pixel ratios, bounding boxes of animated elements, elements outside the viewBox or at (0,0), loop seamlessness. |
A short summary is printed to stdout (--json prints the report instead).
Contact sheet of tests/fixtures/pipeline.svg (SMIL dots,
a pulsing CSS hub and a spinning badge; detected cycle: LCM of 2s and 4s):
Its motion heatmap:
And a buggy one, tests/fixtures/parked_dot.svg:
<animateMotion begin="1s"> leaves the dot parked in the top-left corner for a second.
Tiles 1-4 show it, the heatmap marks the corner, and the report says
parked-at-origin: circle#dot sits at the SVG origin (0,0) at t=0.00s, 0.27s, 0.55s, 0.82s.
Install
uv tool install framesheet # or: pip install framesheet
framesheet install-browser # downloads Playwright's Chromium (once)
framesheet install-browser runs python -m playwright install chromium in framesheet's
own environment, so the browser matches the installed Playwright version. In a project
environment, uv run playwright install chromium does the same. On a bare Linux CI
runner add --with-deps (uv run playwright install --with-deps chromium).
CLI
framesheet inspect banner.svg # writes to a new temp dir, prints it
framesheet inspect banner.svg --out /tmp/check # choose the output dir
framesheet inspect banner.svg -n 16 --at 1.25 # 16 tiles, full.png at t=1.25s
framesheet inspect page.html --size 1440x900 --scale 2
framesheet inspect canvas.html --duration 4 # JS-driven: give the cycle length
framesheet inspect a.svg b.svg --out /tmp/all # one subdirectory per input
cat snippet.svg | framesheet inspect - # SVG or HTML snippet on stdin
framesheet inspect https://example.com/anim.html
framesheet inspect banner.svg --json | jq .loop
Options: --frames/-n, --duration, --at, --size WxH, --scale, --out/-o,
--tile, --columns, --keep-frames (also write every frame to frames/), --dark
(prefers-color-scheme: dark), --json. The exit code is 1 if an error-level finding
was reported (for example malformed XML or a broken #id reference), 2 for usage
problems or a missing browser, 0 otherwise.
Example summary:
framesheet: tests/fixtures/non_seamless.svg (svg, 400x200 @1x)
duration: 3s detected: loop period 3s (1 animation(s): css-animation) [looping]
frames: 12 at t=0.00..2.98s; max change 2.8% at t=2.45s
loop: NOT seamless (last frame -> first frame changes 4.73% of pixels, one normal step changes 0.40%)
animated elements: circle#runner
findings: 0 error(s), 1 warning(s), 0 info
WARN [render] non-seamless-loop: The loop jumps at the cycle end: ...
images:
full /tmp/framesheet-x1y2/full.png (t=0s: layout, text, margins)
sheet /tmp/framesheet-x1y2/sheet.png (motion over one cycle)
heatmap /tmp/framesheet-x1y2/heatmap.png (what moves at all)
report /tmp/framesheet-x1y2/report.json
Python API
import framesheet
result = framesheet.inspect("banner.svg", frames=12, out="/tmp/check")
print(result.summary())
print(result.duration.seconds, result.duration.detail)
print(result.loop.seamless, result.images.sheet)
for finding in result.findings:
print(finding.severity, finding.code, finding.element, finding.times)
# Markup strings work too (anything starting with "<").
framesheet.inspect('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">...</svg>')
inspect() returns an InspectionResult (pydantic model): image paths, duration,
times, frames (per-frame metrics), elements (per-frame boxes of animated elements),
loop, findings and console_errors. It uses Playwright's sync API, so call it
outside a running asyncio loop (or in a worker thread).
JavaScript / TypeScript (npm)
The npm package framesheet (in js/) is a TypeScript port with
the same in-page runtime, report schema and image layout, for Node/Bun servers and
Playwright e2e suites:
import { inspect, inspectPage } from "framesheet";
import { expectAnimation } from "framesheet/test";
const result = await inspect("banner.svg", { frames: 12 }); // PNG buffers + report
await expectAnimation(page.locator("#mindmap"), "mindmap-open", { frames: 8 }); // visual regression
See js/README.md for inspectPage (components in a running app),
prepare (fake clock for JS-driven motion) and server notes.
The agent loop
- Run
framesheet inspect FILE --out DIR. - Read the summary, fix every
ERRORandWARN. - Look at
full.pngfor layout: text clipping, cramped margins, connectors meeting card edges, contrast. - Look at
sheet.pngfor motion: does every tile look intentional? Do the first and last tile join up for a loop? - Look at
heatmap.pngfor unexpected movement: anything coloured that should be still? - Use
report.jsonfor numbers (boxes per frame, changed-pixel ratios, seam ratio). - Re-run until clean.
How time is controlled
framesheet never takes wall-clock screenshots. Everything runs on a virtual clock:
- SMIL:
pauseAnimations()+setCurrentTime(t)on every outermost<svg>. - CSS animations/transitions and Web Animations: every
document.getAnimations()entry is paused and itscurrentTimeset tot. - JavaScript (
requestAnimationFrame, canvas,Date,performance.now, timers): Playwright's fake clock is installed before the page loads and only advances when framesheet moves to the next sample time, firing every due timer and rAF callback.
The cycle length is detected from SMIL begin/dur/repeatCount and CSS/Web Animation
timing (delay + duration x iterations, alternate = 2x duration, several loops = least
common multiple when short enough). Override it with --duration; with no declarative
animation framesheet samples 3 seconds and tells you so.
Checks
Static checks (ported from the svg-animation skill's verify_svg.py): malformed XML,
missing xmlns/viewBox/title, <script>, on* handlers, external URLs and fonts,
<foreignObject>, duplicate ids, broken #id/url(#id) references, positive
<animateMotion begin>, missing prefers-reduced-motion, CSS transforms without
transform-box, large files.
Render checks (from geometry at every sampled frame): parked-at-origin,
outside-bounds, text-overflow (SVG text vs. the rect under it; HTML text larger than
its box), svg-transform-box (CSS transform animation pivoting around the SVG origin),
non-seamless-loop, js-driven-motion, console-error.
Repository layout
| Path | What |
|---|---|
src/framesheet/ |
Python package (PyPI framesheet) |
src/framesheet/runtime.js |
In-page time-control runtime, shared: the npm build embeds it byte for byte (CI checks) |
js/ |
npm package framesheet (TypeScript, Playwright peer dependency) |
schema/report.schema.json |
JSON Schema of report.json, generated from the pydantic models; both implementations are tested against it |
schema/golden/ |
Python reports for the fixtures; the npm tests compare against them |
tests/fixtures/ |
Deliberately flawed SVG/HTML, used by both test suites |
Limitations
- Chromium only. Fonts are whatever the machine has, so text widths can differ from macOS/Windows; leave slack in text containers.
- Animations created by script after load are timed from the sample at which framesheet first sees them (accurate to one sample step).
- JS clocks run about 17 ms (one frame) ahead of SMIL/CSS time so that rAF content has
painted at
t=0. - Content outside the viewBox is clipped in the images; the report still lists it.
Metadata
Release files for framesheet 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| framesheet-0.1.1.tar.gz | 43.9 kB | With provenance | Details for framesheet-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| framesheet-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for framesheet-0.1.1-py3-none-any.whl |
Total release size: 85.8 kB
Release files / framesheet-0.1.1.tar.gz
| Download URL | framesheet-0.1.1.tar.gz |
|---|---|
| Size | 43.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28518571dc895a2d7d4d2bcd66009fcb31cc7c513335edbccfedaa52ac1db175
|
|
BLAKE2b-256 checksum How to use checksums |
19e322021fc2004ba24c861b59c5e894dd2410aec5a120a8bfebc1c54e2d16d4
|
| 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 Nov 22, 2026.
Transparency logRelease files / framesheet-0.1.1-py3-none-any.whl
| Download URL | framesheet-0.1.1-py3-none-any.whl |
|---|---|
| Size | 41.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
831a948744166a96bf25dc34f60bc66dd207c79a11785c49a5f11a360cea2bc5
|
|
BLAKE2b-256 checksum How to use checksums |
53fe6055a7c9705cf014216aee9e41ca25a27d0f83bf87d3bf70e7dbd7d4baac
|
| 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 Nov 22, 2026.
Transparency logSecurity for framesheet 0.1.1
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
Both files in this release have been uploaded with provenance metadata.
Attestation for framesheet-0.1.1.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 Nov 22, 2026.
Transparency logA 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.