Skip to content

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

video-loop: img2webp -exact needs libwebp 1.5; CI installs 1.6.0

Soohong Kima982c9541992
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cdf5cb5..7d9f868 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,11 +19,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Install the pipeline's required binaries (ffmpeg for video-frames, libwebp >= 1.3 for video-loop -exact)
+ - name: Install the pipeline's required binaries (ffmpeg for video-frames, libwebp >= 1.5 for video-loop -exact)
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq ffmpeg
- curl -fsSL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.4.0-linux-x86-64.tar.gz | tar -xz -C /tmp
- sudo cp /tmp/libwebp-1.4.0-linux-x86-64/bin/* /usr/local/bin/
+ curl -fsSL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.6.0-linux-x86-64.tar.gz | tar -xz -C /tmp
+ sudo cp /tmp/libwebp-1.6.0-linux-x86-64/bin/* /usr/local/bin/
img2webp -h 2>&1 | grep -q -- -exact # img2webp -version exits 1 without an output file; -h is the honest probe
- uses: actions/setup-python@v5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 799b772..5893ec1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@ All notable public changes to `sprite-gen` are recorded here. Versions track the
## v2.0.3 - One standing height
-- `video-loop` checks that `img2webp` actually supports `-exact` (libwebp >= 1.3; Ubuntu 22.04 ships 1.2.x) and fails by name otherwise instead of writing WebP with rewritten RGB under alpha; CI installs `ffmpeg` and the official libwebp 1.4.0 binaries so the video tests run there, and those tests skip cleanly where support is absent.
+- `video-loop` checks that `img2webp` actually supports `-exact` (libwebp >= 1.5; Ubuntu 24.04 ships 1.3.x) and fails by name otherwise instead of writing WebP with rewritten RGB under alpha; CI installs `ffmpeg` and the official libwebp 1.6.0 binaries so the video tests run there, and those tests skip cleanly where support is absent.
- `video-loop` `body_h` is the standing height (tallest floor-contact frame) instead of the cycle's median bbox height, which under-measured jumps and over-scaled them by ~22 %; `--body-height N` scales every state to the same standing height directly in the pipeline (`--strip-height` remains the cap). README heroes regenerated at one standing height.
## v2.0.2 - Heroes from the pipeline
diff --git a/sprite_gen/video/loop.py b/sprite_gen/video/loop.py
index 6b8fb62..90df901 100644
--- a/sprite_gen/video/loop.py
+++ b/sprite_gen/video/loop.py
@@ -305,8 +305,9 @@ def build_strip(frames: list[Image.Image], *, max_cells: int = STRIP_MAX_CELLS,
def img2webp_supports_exact(binary: str | None = None) -> bool:
- """libwebp added `-exact` to img2webp in 1.3; older builds (Ubuntu 22.04: 1.2.x) reject the
- flag with "Unknown option" and would rewrite RGB under alpha 0. Detected from `-h`, never assumed."""
+ """libwebp added `-exact` to img2webp in 1.5.0 (checked against the 1.4.0 and 1.5.0 release
+ binaries, 2026-09-09); older builds (Ubuntu 24.04: 1.3.x) reject the flag with "Unknown option"
+ and would rewrite RGB under alpha 0. Detected from `-h`, never assumed."""
binary = binary or shutil.which("img2webp")
if not binary:
return False
@@ -325,8 +326,8 @@ def write_webp(frames: list[Image.Image], out: Path, *, delay_ms: int, workdir:
raise SystemExit("video-loop: `img2webp` not found on PATH — install libwebp (brew install webp) for exact-alpha WebP")
if not img2webp_supports_exact(img2webp):
raise SystemExit(
- "video-loop: this img2webp has no `-exact` option (libwebp < 1.3; Ubuntu 22.04 ships 1.2.x) — "
- "install libwebp >= 1.3 (brew install webp, or the official binaries from storage.googleapis.com/downloads.webmproject.org)"
+ "video-loop: this img2webp has no `-exact` option (libwebp < 1.5; Ubuntu 24.04 ships 1.3.x) — "
+ "install libwebp >= 1.5 (brew install webp, or the official binaries from storage.googleapis.com/downloads.webmproject.org)"
)
workdir.mkdir(parents=True, exist_ok=True)
paths = []