A library of 232 pixel art effects (fire, explosions, magic, weather, UI) as small JavaScript modules, plus a Claude Code skill for making new ones.
aldegad/sprite-gen
Codex/Claude skill and Python CLI that turns one base image into game-ready 2D sprite atlases or transparent animation loops.
- Stars
- 3,843
- Forks
- 400
- Open issues
- 2
- Last commit
- 18 hours ago
What is it?
sprite-gen addresses a common problem with AI image models: asking for a sprite sheet usually yields a character whose appearance shifts between frames, backgrounds that don't key out cleanly, and PNGs that game engines can't consume directly. The tool starts from a single base image, generates each animation state row by row while keeping the character consistent, removes the chroma-key background into real alpha, and extracts each pose as a transparent frame.
The output is a runtime atlas (sprite-sheet-alpha.png) accompanied by a manifest.json containing absolute frame rectangles, per-state fps and loop flags. Alternatively, the same still image can be passed to a video model to produce a seamless transparent loop per motion state. A curation webview lets users compare, reject, adjust and preview loops before baking the final assets.
The project is organised as several pipelines and utilities: an atlas-row pipeline, a video-to-loop pipeline, utilities for slicing and cutting sheets, post-processing for recoloring and engine exports (Aseprite, Phaser, Flame), independent asset tools such as tiling and shadow projection, and an optional scene composition workflow.
Key features
- 01Generates sprite states row by row from one base image while keeping the character consistent.
- 02Converts chroma-key backgrounds into real alpha and extracts clean transparent frames.
- 03Outputs a runtime atlas with a manifest.json listing frame rectangles, fps and loop flags.
- 04Produces transparent animation loops from video models, one per motion state.
- 05Provides a curation webview for reviewing, nudging and previewing frames before baking.
- 06Includes recoloring and exports to Aseprite JSON for engines like Phaser and Flame.
Use cases
- Turning a single character illustration into a full set of idle, walk, attack and jump sprites for a 2D game.
- Generating transparent looping animations from one still image using a video model.
- Recoloring an existing sprite sheet into multiple palette variants.
- Exporting sprite atlases to Phaser or Flame via Aseprite JSON.
Quick start
- 1
Create and activate a Python virtual environment
python3 -m venv .venv && source .venv/bin/activate - 2
Install sprite-gen in editable mode
pip install -e . - 3
Check that the CLI runs
sprite-gen --help
Things to know
- Image and video generation need your own Codex or Grok subscription login, or an API key such as XAI_API_KEY.
- Video loops also require ffmpeg and img2webp installed separately.
- Walk and run loops are experimental unless motion QA passes, and direction correction is opt-in and can be wrong.
In collections
Topics
FAQ
- What is sprite-gen?
- Codex/Claude skill and Python CLI that turns one base image into game-ready 2D sprite atlases or transparent animation loops. sprite-gen addresses a common problem with AI image models: asking for a sprite sheet usually yields a character whose appearance shifts between frames, backgrounds that don't key out cleanly, and PNGs that game engines can't consume directly. The tool starts from a single base image, generates each animation state row by row while keeping the character consistent, removes the chroma-key background into real alpha, and extracts each pose as a transparent frame.
- Is sprite-gen free to use? What license does it have?
- sprite-gen is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is sprite-gen still maintained?
- Actively maintained. The last commit to sprite-gen was on Nov 6, 2026.
- What can I use sprite-gen for?
- Turning a single character illustration into a full set of idle, walk, attack and jump sprites for a 2D game. Generating transparent looping animations from one still image using a video model. Recoloring an existing sprite sheet into multiple palette variants. Exporting sprite atlases to Phaser or Flame via Aseprite JSON.
- How do I install sprite-gen?
- Create and activate a Python virtual environment: python3 -m venv .venv && source .venv/bin/activate Install sprite-gen in editable mode: pip install -e . Check that the CLI runs: sprite-gen --help
- Where can I get sprite-gen?
- The source code and installation instructions are on GitHub: https://github.com/aldegad/sprite-gen
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An agent skill that turns one approved character still into a full set of game-ready 2D sprite animations, with transparent PNG frames and GIF/WebM/Godot/Aseprite exports.
A Rust CLI and WASM tool that snaps messy AI-generated pixel art onto a clean, consistent pixel grid with a fixed palette.
An agent skill for Claude Code and Codex that turns one reference image into a playable 2D browser game prototype.
A virtual office that shows each Claude Code or Codex project as a room and each agent as a pixel-art character with live activity.
No-code, open-source game engine and editor for building 2D, 3D and multiplayer games for mobile, desktop and the web.