Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
docs: the held-drawings hold is read over the cut (cycle_drawings); changelog
Soohong Kim9e0910554424
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex dcee34f..33876a1 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,10 @@All notable public changes to `sprite-gen` are recorded here. Versions track the `version:` field in `SKILL.md` and `pyproject.toml`.+## Unreleased - A held loop is judged on the cycle cut out of its clip, not on the whole clip++- **Output change: which loops `video-cycle-align` names for a retake** (`held-drawings`). The hold was read over the whole clip and given to the cut cycle, so a clip held for part of its length and drawn every frame for the rest was judged by the clip: a cycle cut from its every-frame part and stretched could be named (the clip reads as held), and one cut from its held part was passed (the clip reads as drawn every frame). `video-loop` now also reads the hold over the cut, on the clip's own steps as keyed from the cut's first frame into the frame after its last (`cycle_drawings` in the loop report and in `strip.json`: `start`, `length`, `steps`, `hold`, `drawings_per_second`, `contrast`), and the alignment uses it (`drawings.source: "span"`, with the clip's reading under `drawings.clip`). A cut of fewer than 12 steps (`held.SPAN_MIN_STEPS`, one window of the clip's reading) is not read on its own: the clip's reading stands (`source: "clip"`), and the row's `span_why` says so, as it does for a loop cut by 2.29.0. A clip held or drawn every frame throughout reads the same over its cut as over the whole: the cut, the strip, the GIF and the WebP are unchanged, and the loop report and `strip.json` gain `cycle_drawings`. [docs/loop-repair.md](docs/loop-repair.md#4-one-cycle-for-a-direction-set--video-cycle-align-video-set---align-cycles-auto).+## v2.29.0 - A clip that shows each drawing for two or three frames is read as such, and the set alignment names a held loop it could not fill as a take to film again- **New: `video-cycle-align` names a loop to film again** (`retake`, reason `held-drawings`). A loop whose clip holds each drawing for two or three frames ("on twos", "on threes"), that the set's length leaves at under 13 drawings a second (`align.RETAKE_DRAWINGS_MIN`; a clip on twos shows 12), with one or more frames between its drawings not made (`align.RETAKE_UNMADE_MIN`: taken from the nearer source frame under `--between auto` or `nearest`, made with a fault and kept under `rife`), is listed in the report's `retake` (`dir`, `name`, `hold`, `source`, `drawings`, `drawings_per_second_filmed`, `drawings_per_second`, `frames_per_drawing`, `unmade`, `limits`) and in a warning line ("film this direction again (held-drawings) — …"). Where the legs swap places between two drawings no interpolator draws them, so each frame `auto` took from the nearer source frame holds a drawing a frame longer and the loop halts there; only a new take drawn every frame fixes it. The set is still aligned and written, exit 0: the reason is for the caller to act on, never silent. Each loop row and its `strip.json` `cycle_align` gain `drawings` (the hold, read from the clip's record) and `retake` (the record, or `null`); `video-set` carries `retake` per state and per item. A held loop at its own length (nothing made), a held loop whose made frames all kept their outline, one squeezed to 13 drawings a second or more, and a loop drawn every frame with a replaced frame are not named.diff --git a/SKILL.md b/SKILL.mdindex 0137f0a..1f6287b 100644--- a/SKILL.md+++ b/SKILL.md@@ -137,4 +137,4 @@ Scene creation consumes finished assets and remains optional. Asset metadata own## Contracts and advanced tools-[run-contract](docs/run-contract.md) owns numeric requests, run layout, atomic publication and curated exports. [architecture](docs/architecture.md) explains domain ownership. [docs index](docs/README.md) lists every specialized feature and QA procedure. `sprite-gen --help` derives the command map from the package catalog. Never replace an engine stage — extraction, the loop cut, set alignment, loop repair — with a script of your own while presenting the result as a pipeline output. Where a stage's result is wrong, use the engine's own options first (another cut with `video-loop --max-len` or `--cycle fixed`, `video-cycle-align --length`, `--between auto` (the default: a made frame that melted takes the nearer source frame) or `--between nearest`, or `--cycles <loop>=<k>` once you have counted a suspect loop's strides), keep the engine's result as the comparison, report the defect against the engine, and name in the delivery each stage done by hand and why. A new clip is for what no stage can reach: the drawing, the motion itself, a clip that holds no whole cycle ([loop-review](docs/loop-review.md)) — and a clip the engine names for one: when the alignment report's `retake` lists a loop (reason `held-drawings`: its clip shows each drawing for two or three frames, the set's length leaves it at under 13 drawings a second, and frames between its drawings could not be made, so the loop halts there), run the engine verbs first as above, then film that direction again and align the set anew rather than hand-painting the gap; tell the user what the reason was and that a new take usually fixes it ([loop-repair](docs/loop-repair.md) section 4).+[run-contract](docs/run-contract.md) owns numeric requests, run layout, atomic publication and curated exports. [architecture](docs/architecture.md) explains domain ownership. [docs index](docs/README.md) lists every specialized feature and QA procedure. `sprite-gen --help` derives the command map from the package catalog. Never replace an engine stage — extraction, the loop cut, set alignment, loop repair — with a script of your own while presenting the result as a pipeline output. Where a stage's result is wrong, use the engine's own options first (another cut with `video-loop --max-len` or `--cycle fixed`, `video-cycle-align --length`, `--between auto` (the default: a made frame that melted takes the nearer source frame) or `--between nearest`, or `--cycles <loop>=<k>` once you have counted a suspect loop's strides), keep the engine's result as the comparison, report the defect against the engine, and name in the delivery each stage done by hand and why. A new clip is for what no stage can reach: the drawing, the motion itself, a clip that holds no whole cycle ([loop-review](docs/loop-review.md)) — and a clip the engine names for one: when the alignment report's `retake` lists a loop (reason `held-drawings`: the cycle cut from its clip shows each drawing for two or three frames, the set's length leaves it at under 13 drawings a second, and frames between its drawings could not be made, so the loop halts there), run the engine verbs first as above, then film that direction again and align the set anew rather than hand-painting the gap; tell the user what the reason was and that a new take usually fixes it ([loop-repair](docs/loop-repair.md) section 4).diff --git a/docs/loop-repair.md b/docs/loop-repair.mdindex 0c7ef7f..1ca64ba 100644--- a/docs/loop-repair.md+++ b/docs/loop-repair.md@@ -353,14 +353,24 @@ sprite-gen video-cycle-align --loop-dir set/front-walk/loop --loop-dir set/side-— no interpolator draws them: a flow model blends the two drawings into a ghost or a meltedshape, which `auto` replaces with the nearer source frame, and that drawing is held a framelonger: the loop halts there. A better interpolator is not the fix; a take drawn every frame is.- - **The hold is the clip's**: `video-loop` measures it over the whole clip as keyed and writes- it into `strip.json` (`drawings`: `hold`, `drawings_per_second`, `contrast`, `frames`; [video- pipeline](video-pipeline.md) section 4). The alignment reads it there (`source: "clip"`, the- cycle's drawings its frames at the clip's rate), and keeps it through a rebuild. A cut cycle is- too short to read a rhythm on reliably, and `--anchor motion-auto` shifts each cut frame, so a- pair's repeat may no longer read as one; only a loop cut before the record is measured on its- own cycle, read as a ring (`source: "cycle"`).- - **The rule**: a loop is named when its source is held (`hold` 2 or 3), the set's length leaves+ - **The hold is the cut's**: `video-loop` measures it on the clip's steps as keyed, before any+ anchor moves a frame, twice, and writes both into `strip.json` ([video+ pipeline](video-pipeline.md) section 4): over the cut (`cycle_drawings`: `start`, `length`,+ `steps`, `hold`, `drawings_per_second`, `contrast`, and a `why` where it was not read) and over+ the whole clip (`drawings`: `hold`, `drawings_per_second`, `contrast`, `frames`). The alignment+ reads the cut's (`source: "span"`, the cycle's drawings its frames at the cut's rate, the+ clip's reading beside it under `clip`): a clip held for part of its length and drawn every+ frame for the rest is held where it was cut, so a cycle cut from its every-frame part is not+ named because the clip reads as held, and one cut from its held part is not passed because the+ clip reads as drawn every frame. The cut's steps run from its first frame into the frame after+ its last, which the cycle returns to, so a cut that starts mid-pair reads as the pairs it holds.+ A cut of fewer than 12 steps (`held.SPAN_MIN_STEPS`, one window of the clip's reading) is not+ read on its own: the clip's reading stands (`source: "clip"`), and the row's `span_why` says+ why — as it does for a loop cut before the cut's record. Both are kept through a rebuild. The+ cut frames themselves are not read while a record exists: `--anchor motion-auto` shifts each,+ so a pair's repeat may no longer read as one; only a loop cut before either record is measured+ on its own cycle, read as a ring (`source: "cycle"`).+ - **The rule**: a loop is named when its cut is held (`hold` 2 or 3), the set's length leavesit under **13 drawings a second** (`align.RETAKE_DRAWINGS_MIN`), and **one or more** framesbetween its drawings were not made (`align.RETAKE_UNMADE_MIN`) — taken from the nearer sourceframe (`auto`'s replacements, every made time under `nearest`) or made with a fault and keptdiff --git a/docs/video-pipeline.md b/docs/video-pipeline.mdindex 3b9c268..53aa686 100644--- a/docs/video-pipeline.md+++ b/docs/video-pipeline.md@@ -760,8 +760,12 @@ inside a 24 fps clip, each drawing shown for two frames ("on twos", or three: "oreport's `drawings` says so, read over the whole clip as keyed, before any cut(`sprite_gen/video/held.py`): `hold` (1 every frame a drawing, 2 or 3; `null` with a `why` for aclip too short or still), `drawings` and `drawings_per_second`, `held_steps`, and `contrast` per-hold — the held steps over the change steps, the evidence. `strip.json` carries the same record-(`drawings`: `hold`, `drawings_per_second`, `contrast`, `frames`) for `video-cycle-align`. The second frame of a pair is rarely a+hold — the held steps over the change steps, the evidence. `cycle_drawings` is the same reading over+the cut alone, on the clip's steps from the cut's first frame into the frame after its last (`start`,+`length`, `steps`; `null` with a `why` under 12 steps, one window). `strip.json` carries both+(`drawings`: `hold`, `drawings_per_second`, `contrast`, `frames`; `cycle_drawings`: `start`,+`length`, `steps`, `hold`, `drawings_per_second`, `contrast`, `why`) for `video-cycle-align`, which+reads the cut's: a clip may hold its drawings for only part of its length. The second frame of a pair is rarely abyte copy: the model redraws it a little, so its step is small, not zero, and a rule that calls astep held under a fraction of the median step misses it (with half the steps held the median fallsbetween the two kinds). So the judgement reads the rhythm: for a hold of 2 or 3, in windows of 12