Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
feat(still-view): a front or back still keeps its view when redrawn from another picture
Soohong Kim37b854c9526c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7df38f7..4051cbe 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,11 @@All notable public changes to `sprite-gen` are recorded here. Versions track the `version:` field in `SKILL.md` and `pyproject.toml`.+## Unreleased++- **A front or back still keeps its view when redrawn from another picture** (`STILL_VIEW_TEXT["front"]`, `["back"]`, read by `still_view_text`): redrawn from a side picture with the clip's one line, a front still could keep part of the picture's turn — feet frontal, head and chest turned a little toward the side the picture faces. The still sentence now says the whole body and head face the viewer squarely, the chest, hips and toes point straight at the viewer, the face is centred between both ears and it is not turned toward either side even when a reference picture shows the character from another angle; the back one says the same from behind, the face hidden and not looking back over the shoulder. It is used whatever the reference's view (a caller does not always know it). The clip's `VIEW_TEXT` is unchanged.+- Measured on codex `image_gen` (subscription), five humanoid characters, three takes per arm, judged blind on full-resolution crops plus an eye-offset metric: side reference to front, 15 of 15 frontal with the old line (the turn did not reproduce on this model) and 15 of 15 with the new; side reference to back, 15 of 15 straight backs either way; front reference to front, 14 of 15 old and 15 of 15 new. Method: [docs/video-pipeline.md](docs/video-pipeline.md).+## v2.18.0 - A walk's jumping frames are remade by RIFE, its jolt is measured, and a direction set shares one cycle- **Jump frames are repaired** (`video-loop --repair auto`, the default for walk and run): a step whose coverage change is 1.4x the loop's median, over the whole body or the hair behind it (`--facing left` mirrors that box), is a jump, and the frame that broke it is replaced by the RIFE frame half way between its two neighbours — at most three, worst first, never next to a frame already made; every other frame stays the video's own. A single stray frame, which breaks the step into it and out of it, is the one remade. The report's `jump_repair` names the frames, the scores before and after and the interpolator; with a frame replaced the seam gate reads the rendered cells. `--repair off` cuts as filmed. On the 2026-10-03 eight-direction set it replaces the frames the experiment did in 8 of 10 views (the other two differ by one frame).diff --git a/docs/video-pipeline.md b/docs/video-pipeline.mdindex d70656a..131b6cc 100644--- a/docs/video-pipeline.md+++ b/docs/video-pipeline.md@@ -141,6 +141,22 @@ in 10 of 10 each; "toward the way its body faces in the image" kept the front onon another character, the back one in 0 of 2. Idle and attack keep their angle in a diagonal (4 of4). A diagonal run is weaker: 2 of 4 kept the angle, the others turned toward a side view.+A front or back still redrawn from a picture seen from another side has its own still sentence too:+with the clip's one line ("seen from the front, facing the viewer directly"),+a front still redrawn from a side picture could keep part of the picture's turn, the feet frontal+and the head and chest turned a little toward the side the picture faces. `still_view_text("front")`+says the whole body and head face the viewer squarely, the chest, hips and toes point straight at+the viewer, the face is centred between both ears, and it is not turned toward either side even+when a reference picture shows the character from another angle; `still_view_text("back")` says the+same from behind, with the face hidden and not looking back over the shoulder. The sentence is used+whatever the reference's view: a caller does not always know it (an uploaded picture), and on a+front reference it changed nothing. The clip keeps its one line, since a clip starts from a still+already drawn at its view. Measured on codex `image_gen` (subscription), five humanoid characters,+three takes per arm, layout guide on, judged blind on full-resolution crops and with an eye-offset+metric: from a side reference the old line already drew a frontal face in 15 of 15 by eye (the turn+did not reproduce on this model), the new sentence in 15 of 15; from behind, both drew a straight+back in 15 of 15; from a front reference, the old line 14 of 15 and the new 15 of 15.+An attack is one timed strike, not a repeat. `MOTION_TEXT["attack"]` asks for one attack: a windup(about 0.5 s), one strike in front (about 0.25 s), a held impact pose (about 0.3 s) and a recoveryto the exact starting stance (about 0.5 s), then `HOLD_TEXT["attack"]`:diff --git a/sprite_gen/video/batch.py b/sprite_gen/video/batch.pyindex 8c4b729..dff933f 100644--- a/sprite_gen/video/batch.py+++ b/sprite_gen/video/batch.py@@ -72,8 +72,21 @@ VIEW_TEXT = {# The view sentence for drawing a still at a view, where it differs from the clip's: a diagonal still is# often redrawn from a front or side picture, so "turned exactly as in the image" would keep the picture's# angle. It says how far the body turns, that the head turns with it and which way the feet point; said-# less, a three-quarter back view came out as a side view or looking back over the shoulder.+# less, a three-quarter back view came out as a side view or looking back over the shoulder. A front or+# back still redrawn from a side picture with the clip's one line kept the picture's turn in the head and+# chest, so those two say where the head, chest and feet point and not to follow the picture's angle.STILL_VIEW_TEXT = {+ "front": (+ "seen from the front: the whole body and head turned to face the viewer squarely, the chest, hips and the toes "+ "of both feet pointing straight at the viewer and the face centred between both ears, looking straight out of "+ "the image, not turned toward either side even when a reference picture shows the character from another angle"+ ),+ "back": (+ "seen from directly behind: the whole body and head turned fully away from the viewer, the back of the head, "+ "the shoulders, the hips and the heels of both feet facing straight at the viewer, the face completely hidden "+ "and not turned toward either side or looking back over the shoulder, even when a reference picture shows the "+ "character from another angle"+ ),"front_diagonal": ("seen from a three-quarter front angle: the whole body and head turned about 45 degrees to the {facing}, halfway ""between facing the viewer and facing {facing}, the face looking the same way as the chest and the feet pointing "diff --git a/tests/video/test_video_pipeline.py b/tests/video/test_video_pipeline.pyindex 4d839d5..fdf35d9 100644--- a/tests/video/test_video_pipeline.py+++ b/tests/video/test_video_pipeline.py@@ -561,14 +561,33 @@ def test_a_diagonal_walk_is_pinned_and_named_as_an_isometric_heading() -> None:def test_a_diagonal_still_is_told_how_far_to_turn() -> None:"""A still at a diagonal is often redrawn from a front or side picture, so its view sentence says theturn (45 degrees), that the head turns with the body and where the feet point, instead of pointing- at the image's own angle. Every other view draws with the clip's view sentence."""+ at the image's own angle. A side still draws with the clip's view sentence."""front = batch_mod.still_view_text("front_diagonal")back = batch_mod.still_view_text("back_diagonal")assert "about 45 degrees to the right" in front and "feet pointing toward the lower right" in frontassert "away from the viewer toward the upper right" in back and "not looking back over the" in backassert "turned exactly as in the image" not in front + backassert batch_mod.still_view_text("side", "left") == batch_mod.VIEW_TEXT["side"].format(facing="left")- assert batch_mod.still_view_text("front") == batch_mod.VIEW_TEXT["front"]+++def test_a_front_or_back_still_does_not_follow_the_pictures_angle() -> None:+ """A front or back still redrawn from a side picture kept the picture's turn in the head and chest with+ the clip's one line, so its view sentence says where the head, chest and feet point and not to follow+ the reference's angle. The clip keeps its own line: it starts from a still already drawn at that view."""+ front = batch_mod.still_view_text("front")+ back = batch_mod.still_view_text("back", "left")+ assert front.startswith("seen from the front:") and back.startswith("seen from directly behind:")+ assert "toes of both feet pointing straight at the viewer" in front+ assert "face centred between both ears" in front+ assert "heels of both feet facing straight at the viewer" in back+ assert "face completely hidden" in back and "not turned toward either side or looking back over the shoulder" in back+ for sentence in (front, back):+ assert "even when a reference picture shows the character from another angle" in sentence+ assert "{" not in sentence+ assert batch_mod.VIEW_TEXT["front"] == "seen from the front, facing the viewer directly"+ assert batch_mod.VIEW_TEXT["back"] == "seen from directly behind, facing away from the viewer"+ clip = batch_mod.build_prompt("front", "idle", "a knight")+ assert batch_mod.VIEW_TEXT["front"] in clip and front not in clipdef test_a_callers_diagonal_gait_keeps_the_angle() -> None: