sprite-gen  by aldegad

AI generates game-ready sprite atlases

Created 1 month ago
450 stars

Top 66.1% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

aldegad/sprite-gen addresses the common problem of AI-generated sprite sheets being unusable in game engines due to inconsistencies and poor asset quality. It provides a pipeline to transform a single base image and action prompts into clean, game-ready sprite atlases with real alpha channels and machine-readable manifests. This benefits game developers by automating the tedious process of cleaning up and preparing generated sprites for integration.

How It Works

The project employs a component-row pipeline: generating state rows, cleaning alpha channels, extracting individual frames, and composing runtime atlases. It ensures character identity consistency across frames, converts chroma key backgrounds to true alpha, and outputs a transparent sprite sheet (sprite-sheet-alpha.png) alongside a manifest.json.frame_layout detailing absolute frame rectangles. This approach guarantees engine-consumable assets without guesswork.

Quick Start & Requirements

  • Installation: Requires Python 3.10+ and a working virtual environment. Install via pip install -e . after cloning.
  • Prerequisites: Pillow library. A standard CPython build is recommended if venv setup fails.
  • Workflow: Involves preparing a run (prepare_sprite_run.py), generating raw state images, extracting frames (extract_sprite_row_frames.py), optional curation (serve_curation.py), and baking the atlas (compose_sprite_atlas.py).
  • Docs: Architecture details are available at docs/architecture.md.
  • Curation: The webview can be launched with python3 scripts/serve_curation.py --run-dir <run-dir> --lang en|ko.

Highlighted Details

  • Output Artifacts: Generates a transparent sprite atlas (sprite-sheet-alpha.png) with verified alpha and a runtime manifest (manifest.json.frame_layout) specifying exact frame rectangles for engine sampling.
  • Curation Webview: A standalone tool for human oversight, enabling side-by-side frame comparison, rejection, and non-destructive transforms (move, scale, rotate, shear) with live animation previews. Edits are saved deterministically.
  • Versatile Application: Beyond sprites, the unpack_atlas_run.py script can process any folder of image candidates (icons, logos) for selection and refinement.
  • Isometric Support: The webview includes an optional floor grid overlay for precise alignment of isometric assets.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), sponsorships, or active development roadmaps are provided in the README.

Licensing & Compatibility

The project is licensed under the Apache-2.0 license. This license is permissive and generally allows for commercial use and integration into closed-source projects.

Limitations & Caveats

The project explicitly marks cyclic locomotion states (walk/run) as experimental unless motion quality assurance passes. While generation achieves approximately 90% of the desired result, the remaining 10% necessitates human curation via the provided webview. Setup requires careful attention to Python virtual environment configuration.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
404 stars in the last 30 days

Explore Similar Projects

Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research), Luis Capelo Luis Capelo(Cofounder of Lightning AI), and
1 more.

hyperframes by heygen-com

3.6%
34k
HTML-native video rendering for AI agents
Created 4 months ago
Updated 20 hours ago
Feedback? Help us improve.