Turn AI-generated character motion into reviewable 256 x 256 sprite sheets:
extract frames, matte and clean them, build horizontal strips, inspect them in a
browser viewer, and promote only approved outputs.
This repo is a practical production kit for indie game devs and AI art builders who have rough generated animation and need assets they can actually evaluate in a game workflow. It includes prompting references, FFmpeg frame extraction, cleanup/repack tools, validation reports, a browser viewer, and an AI-assistant skill for guided runs.
It intentionally excludes generated assets, videos, scratch outputs, demo sheets, and project-specific art.
Note for AI agents: this README is written for human readers. For the operational workflow, start with
AGENTS.md, thendocs/ANIMATION_PIPELINE_NOTES.md.
- Starts from AI-generated motion, Kling clips, or other source animation videos.
- Extracts ordered PNG frames with an FFmpeg wrapper.
- Removes light or flat chroma backgrounds when needed.
- Packs frames into transparent
256 x 256cells while preserving the source video canvas, so character scale and empty space stay consistent across animations. - Writes a horizontal sprite strip, matching individual frame cells, a preview image, and a JSON validation report.
- Lets you inspect generated and final sheets in a browser viewer before promotion.
The core before/after is simple: rough character motion in, reviewable game-art sprite strip out.
-
Put source animation videos in
Videos/orVideos/To Be Processed/. -
Set up Python dependencies:
python3 -m venv .venv ./.venv/bin/python -m pip install -r requirements.txt
FFmpeg is not installed by
requirements.txt; install it separately sotools/extract_frames_ffmpeg.pycan call theffmpegcommand:# macOS brew install ffmpeg # Windows, with winget winget install Gyan.FFmpeg # Ubuntu/Debian Linux sudo apt install ffmpeg
-
To create or refine source footage, use:
docs/reference/PROMPTING_IMAGE_MODELS.mdfor first poses, character references, and transition frames.docs/reference/PROMPTING_VIDEO_MODELS.mdfor Kling or other image-to-video prompts.
-
To process footage, follow
docs/QUICKSTART.md: extract frames, matte if needed, build the sprite sheet, review the preview/report, open the viewer, and promote only approved outputs. -
After processing, run the viewer server:
node tools/serve_sprite_viewer.mjs
-
Open the printed local URL in a browser to inspect the generated sheet or promoted final sheets. Assistants should also return a Markdown link to the exact review URL, such as
[open sprite viewer](http://127.0.0.1:8000/...)or[open alignment review](http://127.0.0.1:8000/alignment-review?path=...), so Codex shows the Web preview card with anOpenbutton. -
If using an AI assistant, give it
skills/sprite-sheet-pipeline/SKILL.mdor install that folder in the assistant's skill system. Ask it to use thesprite-sheet-pipelineskill.
tools/: frame extraction, matting, cleanup/repack, contact sheet, resize, and viewer manifest utilities.docs/: active workflow notes, quickstart, folder conventions, extraction notes, and game integration guidance.docs/reference/: text-only image/video prompting references for creating clean animation source footage when needed.skills/sprite-sheet-pipeline/: AI-assistant skill that routes image prompting, video prompting, processing, validation, and promotion tasks to the right docs.sprite_viewer.html: browser viewer for horizontal sprite sheets.tools/serve_sprite_viewer.mjs: local server for live sheet scanning, direct work-in-progress sheet review, and alignment candidate review pages.sprite_gallery_manifest.js: empty starter manifest for the viewer.sprite_gallery_pins.json: empty starter pin list for the viewer.- Empty
Videos/,work/,Final Sprite Sheets/, andCleanup/folders with.gitkeepfiles so the repo starts with the expected shape.
- Put source animation videos in
Videos/orVideos/To Be Processed/. - Extract ordered frames into
work/extracted/<character>/<action>/. - Matte light backgrounds into
work/matted/<character>/<action>/when needed. - Build a sprite strip with
tools/animation_pipeline.py. Default to 24 frames when no frame count is specified. - Review the preview image and JSON report.
- Run
node tools/serve_sprite_viewer.mjsand inspect the generated sheet in a browser. - Promote only approved sheets and matching cells into
Final Sprite Sheets/<GameName>/<CharacterName>/<animation>/.
See docs/QUICKSTART.md for copy-paste commands.
Keep generated materials out of this repo unless they are tiny, intentional, text-documented references that are required to explain or test pipeline behavior. Normal source videos, extracted frames, matted frames, previews, reports, final sheets, and game/demo art should stay ignored by default.