Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
docs: route scene art verbs in SKILL, READMEs and CHANGELOG
Soohong Kim7efc74c6838e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f3e12a5..0f5ce94 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,12 @@ All notable public changes to `sprite-gen` are recorded here. Versions track the## Unreleased+- **New: `background-tile --axis xy` makes one tile seamless in both directions and measures both joins.** It quilts along x, then along y with a cyclic seam: the second seam's two ends, which meet across the x wrap, may differ by one step at most, so the second quilt cannot break the first one's join. The report measures the finished tile on both axes (`axes.x`, `axes.y`, each with its join, quilt seam, `status` and reasons); the top-level `status` is `needs-review` when either axis is, and each reason names its axis. Two separate one-axis runs had no such rule, and the second run's report measured only its own axis. `inspect_tile_xy(image)` measures both joins of any tile ([asset-tools](docs/asset-tools.md#both-axes-a-ground-tile)).+- **New: alpha haze cleanup for transparent sheets (`frames.alpha_floor.clear_haze`).** Pixels at or above a floor, and faint pixels within a few pixels of them (an object's anti-aliased edge), are kept byte for byte; every other faint pixel becomes fully transparent. The report measures the haze share before and after and counts the solid and edge pixels that changed (`0`). Used by `ui-kit` (on by default) and `slice-sheet --alpha-floor N` (off by default; writes `<prefix>alpha-cleanup.json`). `slice-sheet --chroma-key none` cuts a sheet that is already transparent on its own alpha ([sheet-slicing](docs/sheet-slicing.md#transparent-sheets)).+- **New verb: `ui-kit` splits a game UI kit sheet into nine-slice elements.** `gen --layout-guide ui-kit` attaches a fixed square layout (panel, button, pressed button, card frame, HP and XP bar frames, timer badge) and asks for each element in its box. `ui-kit --sheet uikit.png --out-dir ui/` clears the haze, assigns parts to boxes by centroid, and writes each element's PNG and `ui-kit.json`: its rectangle, its stretch (`xy`, `x` for the bars, `none` for the badge), nine-slice insets measured so that every corner ornament and end cap lies in a fixed slice, and the content padding (a bar frame's track, a panel's text area). An ornament in the middle of an edge, an empty box or a stray part is reported or refused ([ui-kit](docs/ui-kit.md)). `--layout-guide` alone is still the one-slot figure guide.+- **New: `game-pack` request and manifest version 2 with `images`, `tiles` and `ui`.** Single images (props) are atlas frames with an anchor and an optional footprint (`"base"` measures where the image meets the ground); tiles are their own PNG and WebP files with their stored and on-screen sizes; `ui.kit` reads a `ui-kit` report into nine-slice entries (frame, size, stretch, insets, padding) and `ui.icons` adds fixed icons. Every number is in pixels of the stored image. A version 1 request is packed byte for byte as before, and a version 1 request naming the new sections is refused ([game-pack](docs/game-pack.md#version-2-images-tiles-and-ui)).+- **Tests** — `tests/background/test_tile_xy.py` (an exact doubly periodic crop, a join that stays visible on one axis names that axis, the cyclic seam), `tests/frames/test_alpha_floor.py` (a haze ring cleared, thin strokes and their anti-aliased edges kept), `tests/frames/test_ui_kit.py` (a synthetic sheet on the layout: insets to the pixel over corner ornaments, a long flourish, a bar's end gem and cap; badge padding inside its ring; a packed kit at four scales keeps ornament fringes out of the stretched middle), `tests/frames/test_slice_sheet_transparent.py`, `tests/compose/test_game_pack_v2.py` (the manifest field by field, refusals, and a version 1 manifest and page pixels frozen from 2.44.0) and the `--layout-guide ui-kit` cases in `tests/gen/test_layout_guide.py`.+- Bump audio processing recipe to version 3, require `ffprobe` on `PATH`, export M4A with `-movie_timescale 48000`, and validate AAC stream duration with `ffprobe`.- Add bounded one-frame decoded length tolerance, preserving loop duration, trimming one-shots, and rejecting shorter buffers and undersized overlaps at export.- Configure loop playback in `createAudioSource` using an internally cached L+1 guard frame buffer while preserving `prepareAudioBuffer` frame contracts.diff --git a/README.es.md b/README.es.mdindex 84c47fb..58d4116 100644--- a/README.es.md+++ b/README.es.md@@ -48,7 +48,7 @@ flowchart LRendsubgraph C["C · utilidades"]direction LR- c1[cutout] ~~~ c2[slice-sheet] ~~~ c3[unpack-atlas]+ c1[cutout] ~~~ c2[slice-sheet] ~~~ c4[ui-kit] ~~~ c3[unpack-atlas]endsubgraph D["D · posprocesado"]direction LRdiff --git a/README.fr.md b/README.fr.mdindex 8a28b0f..3182c87 100644--- a/README.fr.md+++ b/README.fr.md@@ -48,7 +48,7 @@ flowchart LRendsubgraph C["C · utilitaires"]direction LR- c1[cutout] ~~~ c2[slice-sheet] ~~~ c3[unpack-atlas]+ c1[cutout] ~~~ c2[slice-sheet] ~~~ c4[ui-kit] ~~~ c3[unpack-atlas]endsubgraph D["D · post-traitement"]direction LRdiff --git a/README.ja.md b/README.ja.mdindex da26476..fb7cf44 100644--- a/README.ja.md+++ b/README.ja.md@@ -48,7 +48,7 @@ flowchart LRendsubgraph C["C · ユーティリティ"]direction LR- c1[cutout] ~~~ c2[slice-sheet] ~~~ c3[unpack-atlas]+ c1[cutout] ~~~ c2[slice-sheet] ~~~ c4[ui-kit] ~~~ c3[unpack-atlas]endsubgraph D["D · ポストプロセス"]direction LRdiff --git a/README.ko.md b/README.ko.mdindex 2ce540d..d8d4e86 100644--- a/README.ko.md+++ b/README.ko.md@@ -54,7 +54,7 @@ flowchart LRendsubgraph C["C · 유틸리티"]direction LR- c1[cutout] ~~~ c2[slice-sheet] ~~~ c3[unpack-atlas]+ c1[cutout] ~~~ c2[slice-sheet] ~~~ c4[ui-kit] ~~~ c3[unpack-atlas]endsubgraph D["D · 후처리"]direction LRdiff --git a/README.md b/README.mdindex e148ca8..224015e 100644--- a/README.md+++ b/README.md@@ -61,7 +61,7 @@ flowchart LRendsubgraph C["C · utilities"]direction LR- c1[cutout] ~~~ c2[slice-sheet] ~~~ c3[unpack-atlas]+ c1[cutout] ~~~ c2[slice-sheet] ~~~ c4[ui-kit] ~~~ c3[unpack-atlas]endsubgraph D["D · post-processing"]direction LR@@ -134,6 +134,7 @@ A watch on one wrist, a pin on one side of the head? Turned over, a right-facing```bashsprite-gen cutout icon.png --white-check # white/ivory → matte, magenta/green → chroma enginesprite-gen slice-sheet --sheet sheet.png --chroma-key magenta --grid 3x2 # multi-figure sheet → per-cell cuts+sprite-gen ui-kit --sheet uikit.png --out-dir ui/ # UI kit sheet (gen --layout-guide ui-kit) → nine-slice elementssprite-gen unpack-atlas --atlas sheet.png # finished atlas → curator-ready run (or --pngs-dir folder/)```@@ -150,6 +151,7 @@ sprite-gen export-aseprite --run-dir <run> # Aseprite JSON```bashsprite-gen background-tile --source background.png --period 512 --overlap 32 --out tile.png+sprite-gen background-tile --source ground.png --axis xy --period 960 --overlap 64 --out ground-tile.png # both wayssprite-gen shadow --source walk.strip.json --out-dir shadows/sprite-gen inspect-motion --source walk.strip.json --out motion.json# Only with known same-foot contact and an isolated foot ROI:diff --git a/README.zh-Hans.md b/README.zh-Hans.mdindex 3638099..934f207 100644--- a/README.zh-Hans.md+++ b/README.zh-Hans.md@@ -48,7 +48,7 @@ flowchart LRendsubgraph C["C · 实用工具"]direction LR- c1[cutout] ~~~ c2[slice-sheet] ~~~ c3[unpack-atlas]+ c1[cutout] ~~~ c2[slice-sheet] ~~~ c4[ui-kit] ~~~ c3[unpack-atlas]endsubgraph D["D · 后期处理"]direction LRdiff --git a/SKILL.md b/SKILL.mdindex 7fd384c..a3e6c2f 100644--- a/SKILL.md+++ b/SKILL.md@@ -119,6 +119,10 @@ hold the arms still, and check the loop with `handed-check --state walk`.| Idle breathing | curation choice, baked by compose | [breathing](docs/breathing.md) || Engine exports | `export-aseprite`, `export-pngs` | [engine-export](docs/engine-export.md) || Background recipe or repeating tile | existing `gen` / `cutout`, then optional `background-tile` | [asset-tools](docs/asset-tools.md#background-recipe) |+| Ground tile that repeats both ways | `gen` (opaque), then `background-tile --axis xy` | [asset-tools](docs/asset-tools.md#both-axes-a-ground-tile) |+| Game UI kit: panel, buttons, card, HP/XP bar frames, timer badge as nine-slice elements | `gen --transparent --aspect-ratio 1:1 --layout-guide ui-kit`, then `ui-kit` | [ui-kit](docs/ui-kit.md) |+| Props or icons on a transparent sheet | `slice-sheet --chroma-key none --alpha-floor 64` | [sheet-slicing](docs/sheet-slicing.md#transparent-sheets) |+| Painted props, a ground tile and a UI kit in a game pack | `game-pack` request version 2 (`images`, `tiles`, `ui`) | [game-pack](docs/game-pack.md#version-2-images-tiles-and-ui) || Standalone projected shadow | `shadow` | [asset-tools](docs/asset-tools.md#projected-shadows) || Duplicate poses, foot contact and stride measurement | `inspect-motion` | [asset-tools](docs/asset-tools.md#motion-and-contact-evidence) || Optional scene placement, lighting, camera and render | `scene-render`, `scene-inspect` | [scene](docs/scene.md) |