pixel-rebuild
Installation
SKILL.md
Pixel rebuild
![]()
A clip goes in. Out comes a folder with index.html + data.js that replays it exactly: the tower above averages 0.26 clearly wrong pixels per frame out of 52,900. The art comes from the source. The page is a replay of its timeline, not procedural characters. The art belongs to whoever drew it, so credit them and ask before posting a rebuild publicly.
| path | what |
|---|---|
scripts/extract.py <clip> --out <dir> |
The whole pipeline: grid → frames → layers → palette → data.js. Copies the player in if <dir>/index.html is missing (it never overwrites one). uv run handles deps; needs ffmpeg |
scripts/check.py <dir> [--gif out.gif] [--gif-scale 3] |
Opens the page in installed Chrome (Playwright channel="chrome"), compares every frame with the source, times real playback, reports page errors; exit 0 = pass. --gif writes the loop with per-frame hold times |
template/index.html |
The player. Reads window.PIXEL from data.js; no build, works from file:// |
Workflow
- Look at the clip first. Run
ffmpeg -i clip.mp4 -vf fps=2,scale=360:-1,tile=4x4 sheet_%02d.pngand Read the sheets. Settle whether the whole frame is the art. A flat margin is fine; captions, UI chrome, watermarks or a phone frame need--crop X,Y,W,H. - Extract:
uv run ~/.claude/skills/pixel-rebuild/scripts/extract.py clip.mp4 --out <dir> [--audio] [--title "Name"]. Read the three log lines that matter (below). - Look at
<dir>/.check/orig-vs-rebuild_*.png: left is the source sampled on the art grid, right is the rebuild. Frame 0, the middle frame and the worst frame are always there. - Verify in Chrome:
uv run …/scripts/check.py <dir>. Pass looks like: mean under ~1 clearly-wrong px per frame, playback within a few frames of expected, no page errors. - Hand over
open <dir>/index.html. Controls: space pause, ← → step a frame,msound (only shown when there is audio),?f=42opens paused on frame 42,window.pixel.seek(n)from the console. Add--gifto step 4 if they want something to post.