Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
release: 2.43.0 — the CHANGELOG section named for the release; the outline line and the crossfade count said exactly
Soohong Kimf3ea3280167c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 3861d13..8e331ef 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,11 +2,11 @@All notable public changes to `sprite-gen` are recorded here. Versions track the `version:` field in `SKILL.md` and `pyproject.toml`.-## Unreleased (v2.43.0)+## v2.43.0 - No loop delivers a ghost frame unmeasured; a cross-fade inside one silhouette is named, not judged- **Fix: no loop path delivers a ghost frame unmeasured — `video-cycle-align` takes a clean source frame beside it.** A video model filming a walk held on twos or threes sometimes leaves a frame half drawn between two drawings: a band of part coverage where a leg was and is going. The alignment took such a frame as filmed at its own time, never measured, and a frame RIFE made beside it carried the band and passed — `--between auto` judged a made frame only against its two neighbours (`dark_excess`, `outline_loss`), and a neighbour that is itself the ghost leaves nothing in excess. Now every frame delivered is read on its own coverage (`rife.ghost`: part-covered pixels, alpha 0.1–0.9, in regions at least 5 px thick, over the frame's solid pixels; a ghost over 0.3 %, `interpolation_quality.GHOST_WARN`). The source loop is screened first (`ghost_screen` per loop row and in `cycle_align`: `limit`, `thick_px`, the loop's own `level`, `reads`, and each filmed `ghosts` frame of `cycle.source/`); a loop whose median frame is over the limit is drawn part-covered (a glow, a translucent cape) and is not judged. Under `auto` and `nearest` a time on a filmed ghost takes the frame after it (or before it), a made frame that is a ghost gives way to the nearer source frame (fault `ghost`), and where that nearer frame is the ghost the other frame beside the time is taken; `rife` keeps both, named. Each such cell is listed in `ghost_at` (`at`, `source`, `ghost`, `taken`) with a warning line; a ghost with no clean frame beside it is kept and the line says to film the direction again. A loop already the set's length is screened the same way. Made frames in `smear` carry their `ghost` reading.- **The same screen in the other loop paths.** `video-loop` records the screen of the cut it delivers for a walk or run (`ghost_screen` in its report and summary, a `warning:` line per ghost naming `cycle/frame-NNN.png`): a loop delivered as cut, never aligned, shows its ghost. The jump repair rejects a proposal that is a ghost, its rounds' `original` and `proposal` carrying `ghost`. `video-loop-compare` and `video-loop-repair` keep their versioned `rife.smear` measures and do not read it. Not seen by the screen: a made frame that blends two drawings inside one silhouette with its outline whole — no part coverage to read; the cross-fade reading below names it. A loop the screen does not read (`reads: false`, drawn part-covered) is now said on stderr too: `video-loop` prints a `warning:` line for its cut (and carries `ghost_screen` in its summary), and `video-cycle-align` a line in `warnings` per such loop — before, only the report said so.-- **Named, not judged: a made frame that cross-fades two drawings inside its silhouette.** Where the legs trade places across a gap wider than the flow follows, RIFE can move the coverage and cross-fade the colour — both drawings' boots at part strength inside one whole outline. That frame has no band of part coverage, nothing darker inside the body, and loses its outline only where the art outlines in near-black: the outline rule counts pixels under 70/255 as outline, so the same cross-fade outlined in grey or brown passed every fault — caught or passed by the palette's accident. `rife.crossfade(made, a, b, t)` reads it relative to the source frames' own edges: in windows 8 % of the body's height where the two source frames differ, pixels at their plain blend at the made frame's fraction (in patches 5 px thick) together with the made frame keeping under 60 % of the sources' strong edges there (local range over 7 px, wider than RIFE's blur) — the strong-edge pixels lost there, over the frame's solid pixels. Over 0.015 (`interpolation_quality.CROSSFADE_LOOK`, `looks`) a made frame is named to look at: `cycle_align.smear` rows carry `crossfade` and `look`, and a kept frame gets a `warnings` line ("may cross-fade two drawings inside its outline … kept"). It is no fault — `auto` keeps the frame and the retake rule does not count it — because checked against frames labelled by eye it does not part them: on synthetic legs over 32 palettes (outline black, brown, grey or none; boots dark, mid, light or none) the colour-blended, coverage-whole frame reads over the line in 209 of 384 (74 of 96 outlined in grey, where the fault rules catch 2; 11 of 96 drawn without outlines) and a clean drawing between two far-apart drawings in 29 of 384. The jump repair takes such a proposal and names it (its round's `look`, the proposal's `crossfade`, a `video-loop` `warning:` line). `video-loop-compare` and `video-loop-repair` keep their versioned measures.+- **Named, not judged: a made frame that cross-fades two drawings inside its silhouette.** Where the legs trade places across a gap wider than the flow follows, RIFE can move the coverage and cross-fade the colour — both drawings' boots at part strength inside one whole outline. That frame has no band of part coverage, nothing darker inside the body, and loses its outline only where the art outlines in near-black: the outline rule counts pixels under 70/255 as outline, so the same cross-fade outlined lighter than 70/255 (grey, a light brown) passed every fault — caught or passed by the palette's accident. `rife.crossfade(made, a, b, t)` reads it relative to the source frames' own edges: in windows 8 % of the body's height where the two source frames differ, pixels at their plain blend at the made frame's fraction (in patches 5 px thick) together with the made frame keeping under 60 % of the sources' strong edges there (local range over 7 px, wider than RIFE's blur) — the strong-edge pixels lost there, over the frame's solid pixels (the windows step by half their size, so one lost pixel is counted in up to four of them). Over 0.015 (`interpolation_quality.CROSSFADE_LOOK`, `looks`) a made frame is named to look at: `cycle_align.smear` rows carry `crossfade` and `look`, and a kept frame gets a `warnings` line ("may cross-fade two drawings inside its outline … kept"). It is no fault — `auto` keeps the frame and the retake rule does not count it — because checked against frames labelled by eye it does not part them: on synthetic legs over 32 palettes (outline black, brown, grey or none; boots dark, mid, light or none) the colour-blended, coverage-whole frame reads over the line in 209 of 384 (74 of 96 outlined in grey, where the fault rules catch 2; 11 of 96 drawn without outlines) and a clean drawing between two far-apart drawings in 29 of 384. The jump repair takes such a proposal and names it (its round's `look`, the proposal's `crossfade`, a `video-loop` `warning:` line). `video-loop-compare` and `video-loop-repair` keep their versioned measures.- **`tests/video/test_crossfade.py`** draws the outlined legs with boots three times the size, the outline grey or black: a frame whose colour run cross-faded inside the drawing's own coverage reads over the line in both, the outline rule catching only the black; the drawing between reads under it, and a clean drawing between legs 13 degrees apart in grey over it (why it is no fault); the alignment keeps a cross-faded frame and names it, where the black one still gives way to its outline fault; an alignment through a stand-in whose colour run blends names each kept frame in a warning line; the jump repair takes a cross-faded proposal and names it; through the real RIFE, where installed, a short step reads no cross-fade; and a loop drawn part-covered is named on stderr by `video-loop` and in the alignment's warnings. `tests/video/test_rife.py` pins the real RIFE's whole verdict on the melted crossing (`outline` and `ghost` one way, `outline` the other, no cross-fade either way), where it pinned only the first fault.- **`tests/video/test_ghost_screen.py`** draws outlined legs with a band of 0.3 coverage between the feet: the measure reads the band and not a softened edge; the alignment takes the clean frame beside a ghost at a whole time and beside a made frame that carries one, keeps it named under `rife` or with no clean frame beside it, screens a loop already that long and leaves a loop drawn part-covered as before; `video-loop` names the ghost in its cut; the jump repair rejects a ghost proposal; and through the real RIFE, where installed, no resampled cell carries the filmed ghost.diff --git a/SKILL.md b/SKILL.mdindex c83b9ba..6cc62a0 100644--- a/SKILL.md+++ b/SKILL.md@@ -1,6 +1,6 @@---name: sprite-gen-version: 2.42.0+version: 2.43.0description: "Generates images and game sprites through GPT or Grok with guided provider choices, separate saved defaults, automatic cleanup and optional curation. Handles sprite requests, ordinary image generation/editing, standalone image-to-video clips (i2v, animate this still, 그록 영상, 이매진 비디오, 스틸 움직여줘, first/last frame, reference-to-video, 영상 이어붙이기, 영상 편집, extend/edit a clip), clips from a video MCP on the agent (ZCRE, 지크 MCP), chroma removal, animation atlases, video loops, 큐레이션뷰, image candidates, 팔레트 스왑, palette swap, recolor, rig layers, engine exports, repeating backgrounds, projected shadows, motion/contact inspection and optional scene composition from existing assets."license: Apache-2.0depends_on:diff --git a/docs/loop-repair.md b/docs/loop-repair.mdindex 4a65fae..af01fd9 100644--- a/docs/loop-repair.md+++ b/docs/loop-repair.md@@ -642,16 +642,17 @@ sprite-gen video-cycle-align --loop-dir set/front-walk/loop --loop-dir set/side-trading places across a gap two or three frames wide — RIFE can move the coverage and cross-fadethe colour: both drawings' boots at part strength inside one whole outline. No band of partcoverage, nothing darker inside the body, and an outline the outline rule reads only where the art- outlines in near-black (it counts pixels under 70/255 as outline): drawn in grey or brown, the same- frame passes every fault.+ outlines in near-black (it counts pixels under 70/255 as outline): outlined lighter than 70/255+ (grey, a light brown), the same frame passes every fault.- `crossfade`: in windows 8 % of the body's height over the frame where the two source framesdiffer, two things in one window — pixels of the made frame's solid body at the plain blend ofthe two at its own fraction and well away from each (in patches 5 px thick, past an edge's softrim), and the made frame keeping under 60 % of the source frames' strong edges there (local rangeover 7 px, wider than RIFE's blur, above half the sources' 95th percentile there): a blend showseach edge at part height, a flow that moved the part shows it whole, only softer. The strong-edge- pixels lost in such windows, over the frame's solid pixels; 0 where it shows no blend. Relative- to the source frames' own edges, so the palette's lightness does not decide it.+ pixels lost in such windows, over the frame's solid pixels — the windows step by half their size,+ so one lost pixel is counted in up to four of them; 0 where it shows no blend. Relative to the+ source frames' own edges, so the palette's lightness does not decide it.- Over **0.015** (`interpolation_quality.CROSSFADE_LOOK`) the frame is named to look at: its`smear` row's `look` is `["crossfade"]`, and a kept frame (`method: rife`) gets a line in`warnings` ("frame 14 (made by RIFE) may cross-fade two drawings inside its outline …; kept").diff --git a/pyproject.toml b/pyproject.tomlindex faabb03..1511c80 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"name = "sprite-gen"# Release discipline: keep this package metadata version synchronized with# SKILL.md's `version:` field in the same release commit.-version = "2.42.0"+version = "2.43.0"description = "Component-row pipeline for clean 2D game sprites and animation atlases"readme = "README.md"license = "Apache-2.0"diff --git a/sprite_gen/video/rife.py b/sprite_gen/video/rife.pyindex 4f8ce34..ad1e9a7 100644--- a/sprite_gen/video/rife.py+++ b/sprite_gen/video/rife.py@@ -266,8 +266,9 @@ def crossfade(made: Image.Image, a: Image.Image, b: Image.Image, t: float) -> flGHOST_THICK pixels thick, past an edge's soft rim), and the made frame keeping under CROSSFADE_KEEPof the source frames' strong edges there — a blend shows each edge at part height, a flow thatmoved the part shows it whole, only softer. The strong-edge pixels lost in such windows, as a- fraction of the made frame's solid pixels; 0 where it shows no blend. Relative to the source- frames' own edges, so a palette's lightness does not decide it (docs/loop-repair.md section 4)."""+ fraction of the made frame's solid pixels — the windows step by half their size, so one lost pixel+ is counted in up to four of them; 0 where it shows no blend. Relative to the source frames' own+ edges, so a palette's lightness does not decide it (docs/loop-repair.md section 4)."""m, fa, fb = (np.asarray(f.convert("RGBA"), dtype=np.float32) / 255.0 for f in (made, a, b))pm, pa, pb = (np.dstack([x[..., :3] * x[..., 3:], x[..., 3:]]) for x in (m, fa, fb))