Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
Merge origin/main (fa897a6, 2.45.2) into main: the release carries the UTF-8 output fix as unreleased
Soohong Kimb8f3686ee9c7
diff --cc CHANGELOG.mdindex 6b697e5,3e904c9..25ff9b2--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -2,10 -2,14 +2,18 @@@All notable public changes to `sprite-gen` are recorded here. Versions track the `version:` field in `SKILL.md` and `pyproject.toml`.+## Unreleased++- **Fix: every command prints on a Windows console or pipe in a legacy code page.** A line a command prints can hold an em dash, Korean or a path in any script; on cp949 (Korean Windows) or cp1252 Python could not encode it, and the command died at the print after its work was done (`background-tile` on Korean Windows). Each command's entry now reopens stdout and stderr as UTF-8 where they are not already (`sprite_gen.util.console.utf8_streams`, called first by every `main()` and by `sprite-gen`); importing sprite_gen leaves a program's streams alone. Test: `tests/util/test_console.py`.++ ## v2.45.2 - The new `video-loop --overlap-wrap off` turns the overlapped wrap off on its own; the motion anchor's fine search is faster and gives the same values++ **Upgrading from 2.45.1: By default a run delivers the same bytes as 2.45.1, sooner, and only `--overlap-wrap off` changes what is delivered.** With the default `--overlap-wrap on`, the loop files, the frames and the report are the same bytes as 2.45.1 (the report's `producer` field names the new version), and `video-loop --anchor motion-auto` finishes sooner. With `--overlap-wrap off`, the overlapped wrap is not tried (the report's `wrap_overlap.skipped` reads `turned off (--overlap-wrap off)`, no RIFE calls), a `warning:` line is printed, and the seam gate refuses the cut as filmed, so the run fails on its seam instead of spending minutes of CPU on RIFE. No restoration schemas change: `source-restoration-v5`, repair report `schema_version` 4, comparison `schema_version` 6.++ - **New: `video-loop --overlap-wrap off` turns the overlapped wrap off alone.** Each frame the overlapped wrap makes is RIFE's frame read with its sixteen single passes, 34 calls of the binary: where RIFE runs on a CPU that is minutes a frame (on two CPU cores with the augmentation off, 160 to 174 s for a frame of a 960 × 960 synthetic walker), and a wrap refused at its first frame costs minutes a run, so a caller that stops the loop at a deadline stopped it before the loop could fail on its own seam. With `--overlap-wrap off` (the default stays `on`) nothing is read or made for the wrap: the report's `wrap_overlap` says `skipped: "turned off (--overlap-wrap off)"` with no `tries` and `calls` 0, a `warning:` line says the overlapped wrap was not made, and the seam gate refuses the cut as filmed (`video-loop: loop seam ratio … exceeds …`). Nothing else changes: the jump repair, the eased retime and the gate run as with it on, and `--repair off` still turns it off with them.+ - **Faster: the motion anchor's fine search reads a row of shifts at once, to the same values.** `video-loop --anchor motion-auto` corrects every two-step cut its seam gate tries before one is taken (up to four, `local_cycle.SEAM_TRIES`) and then the cut it takes, and each correction runs the fine search six times (`motion_anchor._register`: 29 × 57 shifts, two masked regions). The search read each shift's masked patch alone, numpy reducing a patch a pixel row at a time, and on a CPU that was most of a walk's cut: on two CPU cores a 960 × 960 cut's correction took 63 s, and the 960 × 960 synthetic walker whose gate tries four cuts was cut (alone, `--repair off`) in 92 s. It now gathers the patches of a row of side-by-side shifts together, a block of mask pixels at a time (`motion_anchor.ROW_BLOCK`), and runs the operations one patch read alone takes in the same order — a patch's mean sums its pixels one after the other, its other two sums run over that patch alone — so every cost is the same value, and the match, the report, the cut and the frames are the same bytes as before. On the same two cores the correction takes 7 s and the walker's cut 27 s.+ - **Tests** — `tests/video/test_loop_overlap.py` (with the overlapped wrap off, the front walker whose tail swings on its own beat has nothing read for its wrap, records it turned off and fails on its seam with the warning line; the closed wrap is the same for the default and an explicit `on`; `video-loop`'s argv carries `--overlap-wrap off` with no RIFE installed, `on` is the default and another word is refused); `tests/video/test_motion_anchor.py` (the fine search against one patch at a time, kept in the test as it was: the same match, costs, search-boundary measurement or none, compared by repr, on the walker, shifts that lay a region off the frame, the search boundary, noise with a flat half or a hole, and a flat frame, with a region past one block of mask pixels; a 960 cut corrected in under half the time this host takes one patch at a time).+## v2.45.1 - An eased stretch that stops the legs is refused; the loop keeps the flow repair**Upgrading from 2.45.0: An eased stretch that puts the body off its beat is refused, its RIFE calls are still spent, and the round records its beat.** Under `video-loop --repair auto` (and `--repair on`), an eased stretch is played only where every window of the rest of the body steps, in each step, as far as it did there in the loop as played, to within a quarter of its usual step (`repair.EASE_BEAT`, 0.25); otherwise it is refused for `the body off its beat` (listed in `rejected_for`), and the loop is delivered as the flow repair left it. RIFE calls made for the retime remain spent (up to 9 calls), the eased round's record gains a `beat` field (`bound`, `off`, `off_max`), and no command-line flags or restoration schemas change: `source-restoration-v5`, repair report `schema_version` 4, comparison `schema_version` 6.