pixel-rebuild

Installation
SKILL.md

Pixel rebuild

A 15.5 s pixel tower loop rebuilt from a 720p reel: rooftop dancer, push-ups, a crate thrown out of a window and carried across the street, a cat, "+1 mint" and "Gm" bubbles

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

  1. Look at the clip first. Run ffmpeg -i clip.mp4 -vf fps=2,scale=360:-1,tile=4x4 sheet_%02d.png and 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.
  2. 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).
  3. 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.
  4. 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.
  5. Hand over open <dir>/index.html. Controls: space pause, ← → step a frame, m sound (only shown when there is audio), ?f=42 opens paused on frame 42, window.pixel.seek(n) from the console. Add --gif to step 4 if they want something to post.
Installs
4
GitHub Stars
8
First Seen
Nov 11, 2026