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(canvas): forced wide keeps a jump's head-room for a square or upright still, and less for a landscape one

Soohong Kimaceb85904602
diff --git a/docs/video-pipeline.md b/docs/video-pipeline.md
index 58aa132..d3d0f4c 100644
--- a/docs/video-pipeline.md
+++ b/docs/video-pipeline.md
@@ -57,8 +57,9 @@ back before the strike); `--facing left` mirrors the wide layout. A forced shape
own row, not the state's: `--shape tall` is the jump row, and `--shape wide` is a forced-wide
row with 35 % above, 28 % in front and 20 % behind — not the attack row. It lands on states
whose own row is another shape, a jump among them, and 35 % on 16:9 keeps about the room a
-jump's tall row leaves above the still, so forcing wide adds width and never takes height
-away. Headroom is a fraction of the full canvas
+jump's tall row leaves above a square or upright still. A still wider than it is tall keeps
+less above it under forced wide than under the tall row (a 3:2 still about three fifths),
+because there the wide canvas's height follows the still's width. Headroom is a fraction of the full canvas
height; wide canvases grow both dimensions to preserve their ratio without shrinking
the still. A still whose corners are not one flat colour
is refused — a non-flat background cannot be extended without guessing.
diff --git a/sprite_gen/video/canvas.py b/sprite_gen/video/canvas.py
index 5f06eda..a5f3ecb 100644
--- a/sprite_gen/video/canvas.py
+++ b/sprite_gen/video/canvas.py
@@ -82,8 +82,10 @@ STATE_CANVAS: dict[str, CanvasProfile] = {
# `--shape wide` is not the attack row. It is forced on a state whose own row is
# another shape — `video-set --shape wide` on every state of a batch, or a retry after
# a side-edge contact — and that state may be a jump. 0.35 on 16:9 keeps about the
-# room a jump's tall row leaves above the still (0.35/0.65 ≈ 0.34/0.66 of its
-# height), so forcing wide adds width and never takes height away.
+# room a jump's tall row leaves above a square or upright still (0.35/0.65 ≈
+# 0.34/0.66 of its height). A still wider than it is tall keeps less than the tall
+# row would give it (a 3:2 still about three fifths), because the wide canvas's
+# height follows the still's width there.
WIDE_OVERRIDE = CanvasProfile(SHAPE_WIDE, 16 / 9, 0.35, 0.28, 0.2, "forced wide: room in front and behind, and a jump's head-room above, whatever the state")
SHAPE_DEFAULTS: dict[str, CanvasProfile] = {
SHAPE_SQUARE: STATE_CANVAS["default"],