danielwh2/sprite-stacking

sprite-stacking allows the agent to first draw (or receive) four orthogonal views—top, side, front, and back—and retains only the voxels covered by all four views. It then slices these into planar layers starting from the ground; during rendering, each layer is rotated, flattened, and shifted up by 1 pixels to create a rotatable pseudo-3D effect. The accompanying Python slicing script allows setting the number of layers, circular carving, and palette size, and can export normal maps and emissive masks. The generated standalone web viewer includes turntable, scene, day/night weather, and driving mini-game modes, and can export PNG sprite sheets in 16 directions. If no image generation model is available, the agent uses short Python scripts to draw the views itself.

sprite-stacking allows the agent to first draw (or receive) four orthogonal views—top, side, front, and back—and retains only the voxels covered by all four views. It then slices these into planar layers starting from the ground; during rendering, each layer is rotated, flattened, and shifted up by 1 pixels to create a rotatable pseudo-3D effect. The accompanying Python slicing script allows setting the number of layers, circular carving, and palette size, and can export normal maps and emissive masks. The generated standalone web viewer includes turntable, scene, day/night weather, and driving mini-game modes, and can export PNG sprite sheets in 16 directions. If no image generation model is available, the agent uses short Python scripts to draw the views itself.

Why It Matters The layer-stacking sprite technique commonly used in indie games allows you to generate layer strips, turntable previews, and multi-directional sprite sheets with a single prompt to the agent, ready for integration into engines like Godot.

Stars 656 (+195 / 24h)

Reasoning

  • 195 new stars in 24 hours, total stars 656 (indicating attention only); MIT license
  • The README notes that layer-stacking sprites are an old technique in indie games; what this skill adds is four-view carving and the agent workflow

Usage

  • npx skills add danielwh2/sprite-stacking (use -g for global installation, -a claude-code to specify the agent). After installing pillow and numpy, tell the agent "make a rotatable pixel-art car"; alternatively, run python3 skills/sprite-stacking/scripts/views_to_slices.py views.png slices.png --slices 36 --html viewer.html directly

Risks

  • Four-view carving can only reconstruct the outer silhouette; concavities invisible from all four directions will be filled in. The result depends on the consistency of the four drawn views.
  • The skills CLI requires Node 22.20 or newer

Open

GitHub

Explore the latest AI Radar updates