Skip to content

Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.

docs: chroma-alpha's Defaults paragraph says what each entry point defaults to and why — the version notes ("in this release", "before: off", the stills' default during development, the video default "until now", the fixes "earlier", "now", "any more") leave, and `--decontam off` gives back the bytes the matte keyed instead of "the 2.45.3 bytes"; the measurements (the still-scene frame-to-frame change, the i5-7500 time and memory, the changed-pixel share) stay, the third case named "with hold, blend and settle" where it said "now"

Soohong Kim594e6d385a6e
diff --git a/docs/chroma-alpha.md b/docs/chroma-alpha.md
index 62b37c5..9f09683 100644
--- a/docs/chroma-alpha.md
+++ b/docs/chroma-alpha.md
@@ -142,7 +142,7 @@ Measured on a procedural ground-truth set (red strands 0.5–3 px wide, outline
The two still-fit rows are v2.10.2's; v2.10.0 measured 0.07 % · 1.14 / 1.14 and 0.16 % · 1.15 / 1.14 on the same set, with the same recall. The video-fit row was measured in September 2026 with the video fit as it was then, which recovered the keyed flank, and has not been re-measured since flank recovery was dropped because that benchmark's inputs and tools are not at hand. The still-fit rows of that table are unchanged, and the scene table under Defaults has the current video fit's numbers.
-**Defaults.** In this release, `sprite-gen video-frames` and `video-set` default to `--decontam auto` (before: `off`). Stills (`cutout`, `gen`) stay `off`: they defaulted to `auto` during development until a regression on Grok's darker magenta greyed warm palette colours; that cap and the frame-edge interaction were fixed, but the still measurements use a green key, so stills remain `off`. The row extractor (`extract`, `inspect`) stays `off` because its frames are a derived cache that `heal` re-derives from raw, so a changed default would silently rewrite every existing run, and pixel-art rows binarize alpha downstream anyway. Video defaulted to `off` until now out of caution rather than a known defect, because the pass was benchmarked on a green key only and the video fit is less decisive than the still fit (10.8 % residual key contamination against 0.03 % on the original benchmark); the Grok-magenta regression and the frame-edge interaction were fixed earlier, and no blocking defect is known. Video defaults to `auto` now because on a chroma key, H.264 4:2:0 chroma mixes the key into every strand one to three pixels wide, leaving an olive rim on red hair over green with the pass off, and the pass gives such edges the subject's own colour back. The video fit drops flank recovery, examining only subject pixels within 6 px of the keyed background, and holds calls, blends changes of call, and settles still pixels across frames so still edges do not sparkle: on a still scene under decoder noise (red strands on painted green), the mean change of each keyed edge pixel from one frame to the next on a dark background was 2.34 with `off` (99th percentile 8.3), 2.27 with hold and settle only (8.3), and 2.25 now (8.0), while key contamination was 6.5 %, 2.3 %, and 2.4 %, respectively. Where `auto` cannot run, it leaves frames exactly as the matte keyed them and records the reason in the report (`decontam.reason`, and per frame in `rows[].decontam`): a white key ("the white matte has no key colour to remove") or a subject with no pixel deeper than 6 px inside the keyed silhouette ("no interior to learn the subject's colours from"). With `--alpha-mode brightness` (emitted light on black, no chroma key), `auto` simply means off and records `decontam: {"mode": "auto", "applied_frames": 0, "reason": "brightness alpha has no key colour to remove"}`, while an explicit `--decontam palette` is refused. To keep the matte as it is, `--decontam off` returns the 2.45.3 bytes exactly. On stderr after its JSON summary, `video-frames` prints a one-line warning starting `video-frames: warning: decontam auto ...` when `auto` did not run on any frame (naming the reason and stating that frames match `--decontam off`), when `auto` skipped some frames, when the subject owns key-coloured material so the palette is not key-free (edges may be repainted in the key colour too), or when the key-coloured part guard kept edge pixels beside a small key-coloured part (stating how many, and that a thin detail of that colour farther out may be repainted); codec noise deep inside the subject guards no edge and raises no warning, brightness alpha prints no warning, and the line ends by naming `--decontam off` as the way to keep the matte as it is. `video-set` lists the same line prefixed by the item name under `warnings` in its set report. On an Intel i5-7500 (1080x1920 synthetic clip, CRF 18, `--spill small`, six frames, one process per run), keying took 1.14 s a frame with `off`, 3.25 s with hold and settle only, and 3.36 s now; peak memory was about 400 MB, 945 MB, and 1155 MB, respectively, about 365 MB more than `off` per megapixel of frame now; `video-set` keys three items at once by default, so at that size it can use about 2.3 GB more than `off` at a moment. Changed pixels are about 2.4 % of each frame (4.7 % in the translucent scene), all within 6 px inside the silhouette; nothing outside it changes any more, and the interior is byte-identical.
+**Defaults.** `sprite-gen video-frames` and `video-set` default to `--decontam auto`. Stills (`cutout`, `gen`) are `off`, because the still measurements use a green key. The row extractor (`extract`, `inspect`) is `off` because its frames are a derived cache that `heal` re-derives from raw, so a changed default would silently rewrite every existing run, and pixel-art rows binarize alpha downstream anyway. Two caveats on the video default: the pass was benchmarked on a green key only, and the video fit is less decisive than the still fit (10.8 % residual key contamination against 0.03 % on the benchmark above). No blocking defect is known. Video defaults to `auto` because on a chroma key, H.264 4:2:0 chroma mixes the key into every strand one to three pixels wide, leaving an olive rim on red hair over green with the pass off, and the pass gives such edges the subject's own colour back. The video fit does no flank recovery: it examines only subject pixels within 6 px of the keyed background. It holds calls, blends changes of call, and settles still pixels across frames so still edges do not sparkle: on a still scene under decoder noise (red strands on painted green), the mean change of each keyed edge pixel from one frame to the next on a dark background was 2.34 with `off` (99th percentile 8.3), 2.27 with hold and settle only (8.3), and 2.25 with hold, blend and settle (8.0); key contamination was 6.5 %, 2.3 % and 2.4 %, respectively. Where `auto` cannot run, it leaves frames exactly as the matte keyed them and records the reason in the report (`decontam.reason`, and per frame in `rows[].decontam`): a white key ("the white matte has no key colour to remove") or a subject with no pixel deeper than 6 px inside the keyed silhouette ("no interior to learn the subject's colours from"). With `--alpha-mode brightness` (emitted light on black, no chroma key), `auto` simply means off and records `decontam: {"mode": "auto", "applied_frames": 0, "reason": "brightness alpha has no key colour to remove"}`, while an explicit `--decontam palette` is refused. `--decontam off` keeps the matte as it is: the frames are exactly the bytes the matte keyed. On stderr after its JSON summary, `video-frames` prints a one-line warning starting `video-frames: warning: decontam auto ...` when `auto` did not run on any frame (naming the reason and stating that frames match `--decontam off`), when `auto` skipped some frames, when the subject owns key-coloured material so the palette is not key-free (edges may be repainted in the key colour too), or when the key-coloured part guard kept edge pixels beside a small key-coloured part (stating how many, and that a thin detail of that colour farther out may be repainted); codec noise deep inside the subject guards no edge and raises no warning, brightness alpha prints no warning, and the line ends by naming `--decontam off` as the way to keep the matte as it is. `video-set` lists the same line prefixed by the item name under `warnings` in its set report. On an Intel i5-7500 (1080x1920 synthetic clip, CRF 18, `--spill small`, six frames, one process per run), keying took 1.14 s a frame with `off`, 3.25 s with hold and settle only, and 3.36 s with hold, blend and settle; peak memory was about 400 MB, 945 MB and 1155 MB, respectively, which is about 365 MB more than `off` per megapixel of frame; `video-set` keys three items at once by default, so at that size it can use about 2.3 GB more than `off` at a moment. Changed pixels are about 2.4 % of each frame (4.7 % in the translucent scene), all within 6 px inside the silhouette; nothing outside it changes, and the interior is byte-identical.
| scene | key contamination | halo dark / white | strand recall |
|---|---|---|---|