sprite-gen: One Image Becomes a 2D Game Sprite Sheet, Free and Open Source
@terryl.in's sprite-gen is a free open-source (Apache-2.0) Python tool — also a Codex/ Code skill — that turns one character image into a game-ready sprite sheet. The AI draws each action as a row; fixed code strips the background, cuts the frames and assembles the sheet.
What this is
A · Image (atlas rows)
One character image + action list → transparent sprite sheet + manifest.json. Image AI: codex ( login), or openai. Walk 6 frames, attack 5 frames, under 1 minute.
B · Video to loop
One character image → each action a transparent looping animation (GIF/WebP/strip). Uses Imagine video. Walk 27 frames, attack 48 frames, about 5 minutes. Smoother than the image workflow, but with its own pitfalls (see below).
Small tools (no AI needed)
cutout, slice-sheet, recolor, export, shadow, repeating background.
Curation step
Opens a web page to compare, delete and fine-tune each frame and preview the loop before re-assembling (optional).
Install
1. The base image must NOT be transparent
The video flow reads the background colour from the four corners; a transparent base is treated as black when filming and white when cutting out — silver armour gets cut away (floating fists, severed shins, jagged edges). Fix: put the character on a pure green (#00FF00) background first and add --key green.
2. The sword grows
draws the sword longer and longer during a swing — up to about twice its original length. sprite-gen can't fix this; check it yourself.
3. Attack frames shrink
sprite-gen measures character height including the raised sword, so sword-swing frames come out smaller than walking frames. Align by the standing height yourself when placing them in the game.
From the comments: check the feet
Check every frame's feet alignment — if the landing point drifts, the character looks like it's ice-skating in-game. Single actions (attack, jump) are most stable at 4–6 frames, while 9 or 12 frames tend to break (repeated bodies, blank cells).