Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
fix(size-hold): a cut by hand reads each of its frames against one partner a cycle away, the frame the caller's length later or, where the clip ends before that, earlier (gait_fallback.at_cut) — the pairs a frame later alone were read as soon as one frame had one: one frame the clip held after a cut on its last cycle left one pair to read the cut, the other 23 frames' pairs earlier dropped, and the walk away's shrink went unheld (0 against -5.27 % expected, refused at 7.94 where it passes at 1.19 with nothing after it); a frame beyond the cut is now the partner of one of its frames, never the reading of the rest: held on 24 pairs with 0, 1 or 5 frames after it (-5.36, -5.36, -5.34 %) as with 0, 1 or 5 before it; where every frame of a cut had a partner later, or none did, the pairs are the ones read before
Soohong Kim131ba965b3c9
diff --git a/sprite_gen/video/gait_fallback.py b/sprite_gen/video/gait_fallback.pyindex ecd036f..e42ce61 100644--- a/sprite_gen/video/gait_fallback.py+++ b/sprite_gen/video/gait_fallback.py@@ -234,7 +234,9 @@ def foot_drift(frames: list[Image.Image], measured: dict) -> dict:def at_cut(frames: list[Image.Image], measured: dict, feet: dict, *, start: int, length: int) -> dict:"""Whether a cut the caller names (`--cycle fixed`) changes size, and moves its feet, one cycle on as the clip readsthem (`cycle_drift`, `foot_drift`), read on the cut itself at the cycle the caller named: each frame of the cut- against the frame `length` later, or `length` earlier where the cut runs to the clip's end.+ against the frame `length` later, or `length` earlier where the clip ends before that. Each frame has one partner,+ so a frame the clip holds beyond the cut is the partner of one frame of it, never the reading of the rest: read on+ the frames with a partner later alone, one frame after a cut on the clip's last cycle left one pair to read it.The clip's reading is over every frame, so frames that are not the walk the cut is (a standing start, anothermotion before the walk, a long run-up), or a clip too short to show the walk's cycle twice inside the lags the@@ -242,11 +244,10 @@ def at_cut(frames: list[Image.Image], measured: dict, feet: dict, *, start: int,`change` is the median of the cut's height ratios (`coverage_heights`) less 1 and `feet_px` the median move of itsfeet's row over the same pairs, both over one cycle; `expected` and `feet_expected_px` are the clip's readingcarried over one cycle. `size` (`feet`): the cut shows at least AT_CUT_SHARE of the expected change, the same way.- No pair (the clip does not show the cut's frames a cycle apart): neither."""+ `pairs` is how many of the cut's frames have a partner; none (the clip holds no frame a cycle from any): neither."""n = len(frames)- pairs = [(k, k + length) for k in range(start, start + length) if k + length < n]- if not pairs:- pairs = [(k - length, k) for k in range(start, start + length) if k - length >= 0]+ pairs = [(k, k + length) if k + length < n else (k - length, k)+ for k in range(start, start + length) if k + length < n or k - length >= 0]expected = (1 + measured["drift"]) ** (length / (n - 1)) - 1feet_expected = feet["change_px"] * length / (n - 1)record = {"pairs": len(pairs), "share": AT_CUT_SHARE, "expected": round(expected, 4),