Skip to content

Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.

fix(background): xy report states size, not a one-axis period

Soohong Kim1afbbd95419a
diff --git a/docs/asset-tools.md b/docs/asset-tools.md
index cd029b3..60d34c7 100644
--- a/docs/asset-tools.md
+++ b/docs/asset-tools.md
@@ -37,7 +37,7 @@ sprite-gen background-tile --source ground.png --axis xy --period 960 --overlap
`--axis xy` makes one square tile, `--period` on each side, that repeats in both directions; the source needs `period + overlap` pixels on both axes. It quilts along x, then along y. The second quilt cannot break the first one's join: its seam's two ends meet across the x wrap, so they may differ by one step at most, like any two neighbouring rows of a seam. Two separate `--axis x` and `--axis y` runs have no such rule, and the second run's report measures only its own axis.
-The report measures the finished tile on both axes. `axes.x` and `axes.y` each hold that axis's join measurement (`edge_color_difference`, `seam_alpha_mismatch`, their interior baselines and thresholds), its quilt seam and search, and its own `status` and `review_reasons`. The top-level `status` is `needs-review` when either axis is, and every top-level reason is prefixed with its axis (`y: Internal quilt color difference exceeds source interior variation.`). `source_crop` and `core_crop` are `[x0, y0, x1, y1]` boxes in the source. Look at a 2 × 2 repeat of the tile before using it.
+The report measures the finished tile on both axes. `axes.x` and `axes.y` each hold that axis's join measurement (`edge_color_difference`, `seam_alpha_mismatch`, their interior baselines and thresholds), its quilt seam and search, and its own `status` and `review_reasons`. The top-level `status` is `needs-review` when either axis is, and every top-level reason is prefixed with its axis (`y: Internal quilt color difference exceeds source interior variation.`). `size` is the tile's `[width, height]` and each axis report keeps its own `period`; `source_crop` and `core_crop` are `[x0, y0, x1, y1]` boxes in the source. Look at a 2 × 2 repeat of the tile before using it.
Python APIs: `make_tile(image, period, *, axis="x", overlap=32)`, `inspect_tile(image, axis="x")` and `inspect_tile_xy(image)` in `sprite_gen.background.tile`. The first returns the image and report (`axis="xy"` included); the others only measure, `inspect_tile_xy` both joins of a tile in the report shape above without the quilt fields. `inspect_tile` is the one measure of a tile's join: [`pixel-draw`](pixel-draw.md#gates)'s G4 tile seam asks it of a drawn tile along x and along y and warns where it says `needs-review`.
diff --git a/sprite_gen/background/tile.py b/sprite_gen/background/tile.py
index 4771fdd..cc854ca 100644
--- a/sprite_gen/background/tile.py
+++ b/sprite_gen/background/tile.py
@@ -339,7 +339,7 @@ def inspect_tile_xy(image: Image.Image) -> dict[str, Any]:
axes = {axis: inspect_tile(image, axis) for axis in ("x", "y")}
reasons = [f"{axis}: {reason}" for axis in ("x", "y") for reason in axes[axis]["review_reasons"]]
return {
- "schema_version": 1, "axis": "xy", "size": list(image.size), "period": image.size[0],
+ "schema_version": 1, "axis": "xy", "size": list(image.size),
"status": "needs-review" if reasons else "pass",
"requires_visual_review": True, "assessment": _ASSESSMENT,
"review_reasons": reasons, "axes": axes,