Sprite-Gen: One Still, Game-Ready Atlases

Introduction
Ask an image model for a “sprite sheet” and you already know the crime scene: face morphs every frame, chroma that won’t key, poses drifting off-grid, and a PNG your engine can’t consume. Cute demo. Dead asset.
sprite-gen (aldegad/sprite-gen) closes that gap. It’s an Apache-2.0 Codex/Claude skill and a Python CLI: one base still in, game-ready sprites out — either a transparent atlas with manifest.json.frame_layout, or seamless transparent motion loops from a video path. Over a thousand GitHub stars in the wild, zero fluff about “AI art vibes.” This is pipeline gear.
The Magic: Component Rows, Real Alpha, Real Manifests
The core bet is boring in the best way: treat generation as a row contract, not a one-shot collage.
Atlas pipeline (A): prepare → gen / gen-set → extract → optional curation → compose-atlas. States become rows. Identity stays locked. Chroma dies into real alpha (unmix, don’t peel). Each pose lands as a clean transparent frame. The bake ships sprite-sheet-alpha.png plus absolute frame rectangles, per-state fps, and loop flags. Your runtime samples rectangles. It never guesses a grid.
Video pipeline (B): still → canvas → video → frames → loop. Jump states get tall canvases, attacks get wide ones, loop points follow the clip’s own period, and one-shots cut rest → action → rest. Transparent GIF/WebP/strips come out per motion state (needs ffmpeg, img2webp, and your own Grok/XAI_API_KEY credential — nothing shipped in the repo).
Utilities + post (C/D): cutout, slice-sheet, unpack-atlas for imports; recolor, compose-layers, Aseprite/Phaser/Flame exports for deterministic variants without regenerating.
Pro Tip
Ship the manifest first, art second. If frame_layout isn’t machine-readable, you’re still hand-slicing in the editor. Treat QA GIFs and contact sheets as gates: cyclic walk/run stays experimental until motion QA actually passes.
How to Run It
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
sprite-gen --helpAtlas path (one still → runtime sheet):
sprite-gen prepare --out-dir <run> --character-id <id> --base-image base.png
sprite-gen gen-set --run-dir <run> --provider codex
sprite-gen extract --run-dir <run>
sprite-gen compose-atlas --run-dir <run>
sprite-gen curation --run-dir <run> # optional: compare, reject, nudge, breatheVideo set path:
sprite-gen video-set --base side=still.png --states idle,walk,run,jump,attack --out-dir set/Install as a skill when you want the agent to drive the verbs:
python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-github.py \
--repo aldegad/sprite-gen --path . --name sprite-genExtras that matter on a real team: Breathe turns curated idle frames into deterministic squash-and-stretch loops from a sidecar field; Backbone Lattice keeps pixel-art on a measured grid; recolor bakes N palette variants with byte-stable outputs.
Conclusion
sprite-gen is the missing bridge between generative stills/video and engine-consumable 2D. One drawing in. Transparent atlas + frame_layout out — or transparent loops when motion belongs to video. Steal the contract even if you keep your own generator: state rows, real alpha, absolute rectangles, motion QA before ship.
Stay sharp. Stop shipping collage sheets.
—Titus
