Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
docs(prop-plate): the plate's shaded side and top go with it, read as shades of prop_plate.rgb joined to the front, the edge rule measured from what went, the new report rows and warning, and CHANGELOG Unreleased (v4.3.0)
Soohong Kime1d3a39ef9ee
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ea14b81..622673a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,18 @@All notable public changes to `sprite-gen` are recorded here. Versions track the `version:` field in `SKILL.md` and `pyproject.toml`.+## Unreleased (v4.3.0)++**Upgrading from 4.2.0: runs without `--prop-plate` are unchanged (only `sprite_gen/video/prop_plate.py` changed, and `video-frames` reaches it only with the flag). Runs with `--prop-plate` now also find and erase shaded sides and tops a video model draws on the plate, erase pale green codec ringing and dark reddened box-edge lines within 4 px of what the plate's pixels and the colour rules took, exclude the side and top and their 4 px rim from `--decontam` palette learning, add `side_px` and `side_touch_px` to each frame row and `side_touching` to the frames report's `prop_plate`, print a third warning line when the plate's shaded side or top meets the subject, and refuse a canvas report without `prop_plate.rgb` before keying (`video-canvas --prop-plate` has always written it). `video-canvas --prop-plate` is unchanged. No new dependency, no model call.**++- **Fix: `video-frames --prop-plate` finds and erases shaded box sides and tops drawn on the plate, using the plate colour from the canvas report.** With the camera following the body, a video model can draw the flat plate as a box with thickness: a shaded side beside its front and a top above it in darker shades of the plate's colour. 4.2.0 matched only the bright front (pixels within 48 of the plate's colour on every channel), leaving any side wider than the 4 px rim in keyed frames and every cut from them as a vertical band of dark magenta, or a grey line where the side was thin. `video-frames --prop-plate` now reads `prop_plate.rgb` along with `prop_plate.box` from the canvas report (refusing a report without `rgb` before anything is keyed with `video-frames: --prop-plate: <path> holds no plate colour (prop_plate.rgb); make the canvas again with video-canvas --prop-plate`) and finds the front, the side and top, and the light span of the blend line by that one colour. In each frame, after the front is found as before, `find` locates the side and top: pixels that are a shade of the plate's colour, meaning the plate's colour times a least-squares brightness `k` (pixel dot colour over colour dot colour) between 0.4 (`SHADE_LEAST`) and 1, with each channel within `k * 48` of `k` times the colour so the tolerance darkens with the colour. They count only when joined to the front side by side or at corners (directly or through other shades), and only in pieces of shades holding at least 1% of the plate's area on the frame each (`PIECE_SHARE`, the same floor as the front's pieces). What is not read as a side: a shade the subject holds apart from the plate; dark magenta codec mixing where the subject's outline crosses the plate (too thin a piece; `side_px` is 0 in every frame of the synthetic clips without a side); a sliver of side the subject hides all but less than `PIECE_SHARE` of (the 4 px rim takes that sliver); black and the plate's colour at 0.35 of its light (at 0.4 it is a shade); and skin tones (of eight skin tones tested, mixed with the plate's colour as a codec blends an edge, the darkest (92, 51, 23) is read as a shade only from 0.47 of the plate's colour and a light one (238, 206, 178) from 0.78). Each frame's reported `box` spans the front and the side and top (seeding the next frame's search window), while `tilt` is measured on the front alone. Erasure and `--decontam` palette exclusion now cover the front, side, and top and the 4 px rim around them.+- **Fix: the third erasure rule measures its 4 px reach from what the plate's pixels and the colour rules took.** In 4.1.0 and 4.2.0, opaque pieces remaining after the magenta and blend-line rules were erased only when they lay wholly within 4 px of the plate's pixels. They now go when they lie in a piece (opaque pixels joined side by side or at corners) wholly within 4 px of what the plate's pixels (front, side, and top) and the two colour rules took. This erases a box's far edge drawn darker and redder than any shade along with the grey line beyond it, and the pale green a codec rings just past the line the plate's edge blends into the key with, while keeping the subject reaching past that 4 px reach (with the rest of the line where its pixels touch it).+- **New: `--prop-plate` prints a third warning line when the plate's shaded side or top meets the subject.** When opaque pixels stay within 4 px of the side and top (`side_touch_px > 0`), a run prints `video-frames: warning: --prop-plate: the plate's shaded side or top meets the subject in N frame(s) (...): they went with the plate, and within 4 px of them the subject's pixels stay but for those tinted magenta; look at the subject's edge there`, naming the first six frames and counting the rest.+- The frames report's `prop_plate` adds `side_touching` (the frames with `side_touch_px` above 0), and each found row in `rows` adds `side_px` (pixels of the side and top found joined to the front; `plate_px` stays the front's) and `side_touch_px` (opaque pixels that stay within 4 px of the side and top).+- Python callers: `sprite_gen.video.prop_plate`: new `shade(rgb, colour)` and `SHADE_LEAST` (`0.4`); `read(report)` returns `rgb` too and refuses a report without it; `find` rows gain `side_px`; `region(row, size, part="pixels")` gains `part` (`"sides"`: the reach round the side and top alone); `erase` reports `side_touching` and rows `side_touch_px`; `warnings` adds the third line.+- **Docs**: [video-pipeline.md](docs/video-pipeline.md) "Prop plate: `--prop-plate`" subsection and canvas paragraph, `SKILL.md` plate paragraph, and the module docstring of `sprite_gen/video/prop_plate.py`.+- **Tests**: `tests/video/test_prop_plate.py` (28 synthetic tests, up from 19 in 4.2.0). Adds the `boxed` clip: the camera pans 4 px a frame, from its fifth frame the plate is drawn as a box with a shaded side (178, 0, 166) and a top (200, 0, 196) a pixel wider each frame up to 10 px and a dark line along the side's far edge, and in its eighth frame the figure rests a hand on the plate's top by its side. Checks: no pixel of the plate, its side or top, or the line round them, and no magenta, in any keyed frame of the three clips (`filmed`, `panned`, `boxed`); each row's `side_px` between the drawn side and top shrunk and grown by 1 px (none before the side is drawn, none in the two clips without a side), and `plate_px` within 5% of the drawn front where the figure is clear of it; `side_touching` naming the frames the figure meets the side or top in, the hand's among them, but not one where the figure hides all of them but a sliver below the piece floor; the third warning line; skin-to-shade distance across eight skin tones (pinning at least 0.45 for the darkest (92, 51, 23), actual 0.47, and at least 0.75 for a light one (238, 206, 178), actual 0.78; black and 0.35 of the plate's light rejected, 0.4 accepted); a direct picture of a box (a 10 px side, a top, the dark edge line, and its grey) where all of it goes and a patch of the side's own colour 12 px past the side stays; the plate found by the report's colour (told blue, no frame finds it) and a report without a colour refused; a direct picture where a 2 px pale green past the left edge line and a thin side reddening toward the key go while a denim bar under the plate keeps every pixel; the figure, its hand included, losing only edge pixels the codec tinted magenta (at most 2 a frame inside its core; in the hand frame 12 of the arm's 942 pixels go against 9 in 4.2.0, none of its core); and the frames away from each frame's plate byte-identical to the frames keyed without `--prop-plate`. Red first on 4.2.0: 7 of the 28 fail, and the `boxed` clip keeps plate pixels in 7 of its 16 frames (175, 189, 370, 572, 738, 738, and 738 px, up to 540 of them magenta). Each new rule undone fails a test: no piece floor for the side's pieces reads false sides in the clips without one (2 fail); shades read without being joined to the front erase the apart patch (1 fails); `SHADE_LEAST` at 0 or 0.3 reads black or too dark a colour as a shade (1 fails); a tolerance not darkened with `k` fails the skin to shade test and the reddened side test, at its find check (2 fail); and the third rule measured from the plate's pixels alone, as in 4.2.0, leaves the pale green and the reddened side in columns 34 to 37 and 58 to 61 (1 fails).+## v4.2.0 - Cut with --fill-held off kept as cycle.source/ beside filled loops so alignment needs no clip frames, with cycle_source in the loop report (video-loop, video-cycle-align)**Upgrading from 4.1.0: loops with no held cell made and cuts with `--fill-held off` give the same files byte for byte as 4.1.0 except the report's `producer.implementation_sha256` (four of seven cuts measured before and after: a synthetic walk with a held frame cut with `--fill-held off`, a synthetic walk with nothing held, and the application's walk flags on a synthetic strider with the fill off and with the fill on where its fill made no cell); cuts that are not loops (played once or an effect's lifetime) and cuts with `--out-fps` were not measured and are unchanged because the new step does not run for them. For a loop at the clip's rate whose held cells were made again, the delivered `cycle/`, `<name>.strip.png`, `<name>.strip.json`, `<name>.gif`, and `<name>.webp` are byte for byte as in 4.1.0 and the report differs only in `cycle_source` and `producer.implementation_sha256` (the other three measured cuts: the held walk, the same with jump repair on, and a walk whose last cells were held), while `video-loop` now cuts the clip's frames a second time with `--fill-held off` to keep `cycle.source/` beside it (0.31 to 0.40 times the loop's output size on test walks, 19.0 to 19.8 KB beside 48 to 64 KB; cut time 0.41 s to 0.75 s on the synthetic walk and 0.83 s to 1.63 s with jump repair on; 14 RIFE binary calls instead of 12 on an Apple GPU on rife-v4.25 and rife-v4.6 where the second cut repairs a ghost), adds `cycle_source` to the loop report and summary JSON, and writes stderr lines around the second cut. An app that cuts in one place and runs `video-cycle-align` in another must carry `cycle.source/` with each loop's cycle frames, strip, strip record, and report so alignment needs no clip frames; loops cut by 4.1.0 or earlier have no `cycle.source/` and align as before.**diff --git a/SKILL.md b/SKILL.mdindex e9171be..c3c66bc 100644--- a/SKILL.md+++ b/SKILL.md@@ -136,7 +136,7 @@ Two rules. When an asset will be shown at a fixed display rate above its clip'sA move played once (a jump, a vault: `once`, `once-return`, `one-shot`) carries its root motion in the strip sidecar by default, the cells unchanged: `root_motion` gives each cell's root (the body's mass centre, cell px), what it stands on, and each air's take-off, landing, seconds and apex; a game reads `root` to place each cell and moves the body on its own physics. A move cut out of a longer motion is named with `video-loop --cycle once --start S --length L`, a hand on something the clip does not draw with `--contact hand=A:B`, metres with `--meters-per-px`; a jump whose body crosses the canvas is named the same way, because it never comes back to a pose it left: the one-shot cut refuses it and its line names the closest return (`the closest return, frames A-B, is R of its departure away`), whose frames are where to start the range. To give the air its own length, gravity and speed, `--air-retime gravity=G,air=T,speed=V` redraws it on that parabola with RIFE's frames between; contacts and the take-off and landing stay as filmed. Tell the user each air in one line, its seconds and its apex (the summary's `air`, e.g. `air 0.42 s, apex 0.21 m`). Details in [video-pipeline](docs/video-pipeline.md#root-motion--a-cut-played-once-where-the-body-is-what-it-stands-on-its-air).-For a move over an obstacle that clears a low wall (such as a vault or a jump), paint a flat magenta plate on the green key with `video-canvas --prop-plate` (which requires `--report`), then pass that canvas report to `video-frames --prop-plate <canvas report json>` to erase the plate from keyed frames. The plate box lives in the canvas report, with no second copy; `video-frames` starts from it and finds the plate again in every frame, so a plate the camera carried off or turned is erased too, and the edge pass learns the subject's colours without it. Read the two warning lines a run can print: frames where no plate was found keep whatever of it they show, and in frames where the plate meets the subject, look at the subject's edge there; tell the user what either names. Details in [video-pipeline](docs/video-pipeline.md#prop-plate---prop-plate).+For a move over an obstacle that clears a low wall (such as a vault or a jump), paint a flat magenta plate on the green key with `video-canvas --prop-plate` (which requires `--report`), then pass that canvas report to `video-frames --prop-plate <canvas report json>` to erase the plate from keyed frames. The plate box and colour (`prop_plate.rgb`) live in the canvas report, with no second copy; `video-frames` starts from the box and finds the plate again in every frame along with any shaded side or top a model drew on it, so a plate the camera carried off, turned, or thickened into a box is erased too, and the edge pass learns the subject's colours without it. Read the three warning lines a run can print: frames where no plate was found keep whatever of it they show, and in frames where the plate or its shaded side or top meets the subject, look at the subject's edge there; tell the user what any of the three names. Details in [video-pipeline](docs/video-pipeline.md#prop-plate---prop-plate).A pinned idle or attack whose last frame the video model drew again has its wrap blended by default (`video-loop --wrap-blend auto`, a redraw only; `off` cuts as filmed), with details in [loop repair](docs/loop-repair.md#6-the-redrawn-wrap-a-pinned-clip-whose-last-frame-the-model-drew-again).diff --git a/docs/video-pipeline.md b/docs/video-pipeline.mdindex 578df14..0db1129 100644--- a/docs/video-pipeline.md+++ b/docs/video-pipeline.md@@ -98,19 +98,21 @@ chroma key, the padding is the corner colour.### Prop plate: `--prop-plate`-A move over an obstacle (a vault, a jump over a low wall) needs something to clear. When asked in words for a wall in the background colour, a video model draws a black slab, and keying leaves that slab in the keyed frames. The obstacle is therefore painted into the still the clip is made from as a flat magenta plate, RGB (255, 0, 255), on the green key, which keying does not take and a later erase pass removes. `video-canvas --prop-plate` (off by default) paints this plate in front of the subject on the side it faces (`--facing`), standing on the subject's foot row (the plate's bottom row is the subject's bottom row). Sized from `canvas.subject_box` on the canvas whose background was normalized to the exact green key, its height is 0.49 of the subject height, its thickness is 0.20, and its near side is 0.84 of the subject height ahead of the subject's front. The flag requires a green key and `--report`. A run writes no canvas and refuses if the key is not green ("--prop-plate paints a magenta plate on a green key"), if `--report` is omitted, for state `effect` ("an effect keeps its source canvas; drop --prop-plate"), or if the plate falls past the canvas edge on the facing side ("frame the subject with room in front (--shape wide, --lead)"). The report records `prop_plate`: `box` (left, top, right, bottom in canvas pixels, right and bottom one past), `rgb`, `subject`, and `of_subject_height` (`height`, `width`, `gap`). This box is the single value used for painting and erasing; `video-frames` reads it from the report with no second copy.+A move over an obstacle (a vault, a jump over a low wall) needs something to clear. When asked in words for a wall in the background colour, a video model draws a black slab, and keying leaves that slab in the keyed frames. The obstacle is therefore painted into the still the clip is made from as a flat magenta plate, RGB (255, 0, 255), on the green key, which keying does not take and a later erase pass removes. `video-canvas --prop-plate` (off by default) paints this plate in front of the subject on the side it faces (`--facing`), standing on the subject's foot row (the plate's bottom row is the subject's bottom row). Sized from `canvas.subject_box` on the canvas whose background was normalized to the exact green key, its height is 0.49 of the subject height, its thickness is 0.20, and its near side is 0.84 of the subject height ahead of the subject's front. The flag requires a green key and `--report`. A run writes no canvas and refuses if the key is not green ("--prop-plate paints a magenta plate on a green key"), if `--report` is omitted, for state `effect` ("an effect keeps its source canvas; drop --prop-plate"), or if the plate falls past the canvas edge on the facing side ("frame the subject with room in front (--shape wide, --lead)"). The report records `prop_plate`: `box` (left, top, right, bottom in canvas pixels, right and bottom one past), `rgb`, `subject`, and `of_subject_height` (`height`, `width`, `gap`). This box and colour (`rgb`) are the single values used for painting and erasing; `video-frames` reads them from the report with no second copy, the colour being the one the plate's front, side, and top are found by.`video-frames --prop-plate <canvas report json>` takes the canvas report path, joining the inputs a run never overwrites. It is checked before frame extraction and refused before keying if the file is not a canvas report or holds no plate ("holds no plate; the canvas was made without --prop-plate").-A video model told to keep the camera still can pan anyway, following the subject, and can turn the plate the subject pushes off, so after the first frames the plate is no longer where the canvas placed it. The plate is therefore found in each frame, on the frame as decoded. The canvas box is carried onto the frame by the ratio of frame size to canvas size, rounded outward on each axis (`start_box`). Each frame is searched in a window reaching the plate's diagonal (measured on `start_box`) past a box on every side: `start_box` on the first frame, and the box found last on every later frame. A frame where no plate is found leaves the last box as it was. The plate's pieces are the pixels within 48 of (255, 0, 255) on every channel, joined side by side or at corners, each holding at least 1% of the plate's area on the frame. The plate is every pixel of its colour in the box its pieces span, so a plate the subject in front of it cuts in two is found whole.+A video model told to keep the camera still can pan anyway, following the subject, and can turn the plate the subject pushes off, so after the first frames the plate is no longer where the canvas placed it. The plate is therefore found in each frame, on the frame as decoded, by the box and colour (`prop_plate.rgb`) in the canvas report (a report without `rgb` is refused before anything is keyed, with `video-frames: --prop-plate: <path> holds no plate colour (prop_plate.rgb); make the canvas again with video-canvas --prop-plate`). The canvas box is carried onto the frame by the ratio of frame size to canvas size, rounded outward on each axis (`start_box`). Each frame is searched in a window reaching the plate's diagonal (measured on `start_box`) past a box on every side: `start_box` on the first frame, and the box found last on every later frame. A frame where no plate is found leaves the last box as it was. The plate's front pieces are the pixels within 48 of the plate's colour on every channel, joined side by side or at corners, each holding at least 1% of the plate's area on the frame (`PIECE_SHARE`). The front is every pixel of its colour in the box its pieces span, so a plate the subject in front of it cuts in two is found whole.-On a passing run, every keyed frame where the plate was found is erased before handover, within a 4 px rim (`rim`) around the plate's pixels, each way and diagonally. The erasure is evaluated on the frame as decoded, not on what the matte or the edge pass made of it. A pixel becomes fully transparent where red and blue lead green by more than 35 and are within 90 of each other (the plate, its edge, or a subject edge pixel the codec tinted magenta), or where it is the line the plate's edge blends into the key. The codec's 4:2:0 chroma leaves that line neither colour (a grey, a dark magenta, a pale green), so it is read by where and what it is: within 2 px of a pixel of the key's colour (each channel within 48 of the key), its luma (the Rec. 601 weights) within 40 of the span between the plate's luma and the key's, and its hue on the axis between them (red and blue within 40 plus 0.35 of how far their mean is from green). The codec can also ring a blue grey into that line, which no colour rule tells from denim, so what is left within the rim after the two rules goes as well when it lies in a piece (opaque pixels joined side by side or at corners) wholly within the rim. The subject in front of the plate keeps its pixels: its skin, cloth, and hair lie off the plate-to-key axis, its dark outline is darker than that luma span, its white is lighter, and a part of the subject reaching past the rim is not a piece wholly within it. Refused runs keep the plate in their refused folder.+With the camera following the body, a video model can also draw the flat plate as a box with thickness: a shaded side beside its front and a top above it, the plate's colour darker. After the front is found, the side and top are found in the same window: pixels that are a shade of the plate's colour, meaning the plate's colour times a brightness `k` between 0.4 (`SHADE_LEAST`) and 1 (`k` is the least-squares fit, pixel dot colour over colour dot colour), with each channel within `k` times 48 of `k` times the colour so the tolerance darkens with the colour. They count only when joined to the front side by side or at corners (directly or through other shades), and only in pieces of shades of at least 1% of the plate's area on the frame each (`PIECE_SHARE`, the same floor the front's pieces have). What is not read as a side: a shade the subject holds apart from the plate (not joined to it); the dark magenta a codec mixes where the subject's outline crosses the plate (too thin a piece); and a sliver of side the subject hides all but less than the piece floor of (the 4 px rim takes that sliver). No skin is a shade: of eight skin tones tested, mixed with the plate's colour as a codec blends an edge, the darkest (92, 51, 23) is read as a shade only from 0.47 of the plate's colour and a light one (238, 206, 178) from 0.78; black and the plate's colour at 0.35 of its light are not shades, while at 0.4 it is one. The box the frame reports spans the front and the side and top, and the next frame is searched from it; `tilt` is measured on the front alone.-The frames report adds `prop_plate`: `canvas_report`, `start_box`, `rim`, `frames`, `frames_changed`, `erased_px`, `not_found` (the frames no plate was found in), `touching` (the frames where opaque pixels stay within the rim: the plate meets the subject), and `rows`, one per frame, with `frame`, `found` and, where the plate was found, `box` (frame pixels, right and bottom one past), `plate_px`, `tilt` (degrees the plate's long axis is turned from upright, clockwise on the frame positive), `erased_px`, and `touch_px`. A run encountering such frames prints a warning line for each list, naming the first six frames and counting the rest: `--prop-plate: no plate found in N frame(s) (...)` (nothing was erased there, so any of the plate they show is still in them) and `--prop-plate: the plate meets the subject in N frame(s) (...)` (look at those frames).+On a passing run, every keyed frame where the plate was found is erased before handover, within a 4 px rim (`rim`) around the plate's pixels (now the front, side, and top), each way and diagonally. The erasure is evaluated on the frame as decoded, not on what the matte or the edge pass made of it. The plate's found pixels become fully transparent, as does any pixel within the rim where red and blue lead green by more than 35 and are within 90 of each other (the plate, its edge, or a subject edge pixel the codec tinted magenta), or where it is the line the plate's edge blends into the key. The codec's 4:2:0 chroma leaves that line neither colour (a grey, a dark magenta, a pale green), so it is read by where and what it is: within 2 px of a pixel of the key's colour (each channel within 48 of the key), its luma (the Rec. 601 weights) within 40 of the span between the plate's luma and the key's, and its hue on the axis between them (red and blue within 40 plus 0.35 of how far their mean is from green). The codec can also ring a blue grey into that line, which no colour rule tells from denim, or a pale green just past it, which lies past the 4 px rim of the plate's pixels, and a model can draw a box's far edge darker and redder than any shade, neither a shade nor read by the magenta rule, with a grey line beyond it, so what is left after the colour rules goes as well when it lies in a piece (opaque pixels joined side by side or at corners) wholly within 4 px of what the plate's pixels and the colour rules took. The subject in front of the plate keeps its pixels: its skin, cloth, and hair lie off the plate-to-key axis, its dark outline is darker than that luma span, its white is lighter, and a part of the subject reaching past that 4 px reach stays, with the rest of the line where its pixels touch it. Refused runs keep the plate in their refused folder.-The edge pass (`--decontam`, see [Chroma and alpha](chroma-alpha.md#decontam--give-the-edge-the-subjects-own-colour-back)) learns the subject's palette on the first frame it runs on, where the plate stands as opaque as the subject. With `--prop-plate`, the plate's place on that frame (its pixels and the 4 px rim around them) is left out of what the palette is learned from, and out of the interior whose key-hued share decides whether the palette is key-free, so the plate's magenta is not learned as a colour the subject owns. Without `--prop-plate` the pass learns as before. `video-loop` cuts of erased frames carry no plate; `video-set` does not paint or erase a plate.+The frames report adds `prop_plate`: `canvas_report`, `start_box`, `rim`, `frames`, `frames_changed`, `erased_px`, `not_found` (the frames no plate was found in), `touching` (the frames where opaque pixels stay within the rim: the plate meets the subject), `side_touching` (the frames with `side_touch_px` above 0), and `rows`, one per frame, with `frame`, `found` and, where the plate was found, `box` (frame pixels spanning the front and the side and top, right and bottom one past), `plate_px` (the front's pixels), `side_px` (pixels of the side and top found joined to the front), `tilt` (degrees the front's long axis is turned from upright, clockwise on the frame positive), `erased_px`, `touch_px`, and `side_touch_px` (opaque pixels that stay within 4 px of the side and top). A run encountering such frames prints a warning line for each list, naming the first six frames and counting the rest: `--prop-plate: no plate found in N frame(s) (...)` (nothing was erased there, so any of the plate they show is still in them), `--prop-plate: the plate meets the subject in N frame(s) (...)` (look at those frames), and `--prop-plate: the plate's shaded side or top meets the subject in N frame(s) (...): they went with the plate, and within 4 px of them the subject's pixels stay but for those tinted magenta; look at the subject's edge there`.-What the erase leaves to the eye: a grey of the subject's own that lies between the plate and the key, against the plate, goes with the blended line, and a piece of the subject the plate cuts off wholly within the rim goes with the plate; a frame no plate was found in (the subject covers all of it, or it moved further than its own diagonal from the last frame) keeps whatever of the plate it shows. The warning lines name those frames. In synthetic tests (a clip whose plate slides a few pixels a frame with one frame turned 12 degrees and one frame without it, a fixed plate drawn one pixel off in two frames, and a figure crossing in front of it), no pixel of the plate's colour or of the magenta rule is left in any keyed frame, the figure loses only the pixels the codec tinted magenta where it crosses the plate (at most 2 a frame), and away from each frame's plate the frames are byte-identical to the frames keyed without `--prop-plate` (edge pass off). No other guard, retry, or measurement is added.+The edge pass (`--decontam`, see [Chroma and alpha](chroma-alpha.md#decontam--give-the-edge-the-subjects-own-colour-back)) learns the subject's palette on the first frame it runs on, where the plate stands as opaque as the subject. With `--prop-plate`, the plate's place on that frame (its front, side, and top pixels and the 4 px rim around them) is left out of what the palette is learned from, and out of the interior whose key-hued share decides whether the palette is key-free, so the plate's magenta and its shades are not learned as colours the subject owns. Without `--prop-plate` the pass learns as before. `video-loop` cuts of erased frames carry no plate; `video-set` does not paint or erase a plate.++What the erase leaves to the eye: a grey of the subject's own that lies between the plate and the key, against the plate, goes with the blended line; a piece of the subject the plate cuts off wholly within 4 px of what the plate's pixels and the colour rules took goes with the plate, while the rest of an edge line stays where the subject's pixels touch and reach past it; and a frame no plate was found in (the subject covers all of it, or it moved further than its own diagonal from the last frame) keeps whatever of the plate it shows. The warning lines name those frames. In 28 synthetic tests (a clip whose plate slides 4 px a frame with one frame turned 12 degrees and one frame without it, a fixed plate drawn 1 px off in two frames, a `boxed` clip panning 4 px a frame where from the fifth frame the plate is drawn as a box with a shaded side (178, 0, 166) and top (200, 0, 196) widening 1 px a frame up to 10 px and a dark far-edge line, and a figure crossing in front of the plate and resting a hand on its top by its side in the eighth frame of `boxed`), no pixel of the plate, its side or top, or the line round them, and no magenta, is left in any keyed frame of the three clips, each row's `side_px` lies between the drawn side and top shrunk and grown by 1 px (0 in frames without a side) and `plate_px` stays within 5% of the drawn front where the figure is clear of it, the figure (hand included) loses only edge pixels the codec tinted magenta (at most 2 a frame inside its core; in the hand frame 12 of the arm's 942 pixels go against 9 in 4.2.0, none of its core), and away from each frame's plate the frames are byte-identical to the frames keyed without `--prop-plate` (edge pass off). No other guard, retry, or measurement is added.```bashsprite-gen video-canvas --still still.png --out canvas.png --state jump --key green --facing right --prop-plate --report canvas.json