sprite-stacking

An agent skill that turns four pixel-art views (top, side, front and back) into a stack of flat slices you can spin as a fake-3D sprite, with a slicer script, a standalone HTML viewer and a 16-direction sprite-sheet export.

  • 149 GitHub stars
  • ⚖️ MIT

Last verified: write-up checked

npx skills add danielwh2/sprite-stacking
sprite-stacking — skill preview

What it is

sprite-stacking is an agent skill for a technique indie games have used for years: a fake-3D object built from a stack of flat sprite layers that rotate against each other. The README is clear that the technique is not new; what this skill adds is a four-view workflow that an agent can run end to end. You give it top, side, front and back orthographic views in one row. The slicer keeps a voxel only where all four views cover it, cuts the resulting volume into a strip of flat layers with the ground first, and renders each layer rotated, squashed for pitch and lifted one pixel. A standalone viewer page then lets you spin the object, scan through slices or explode it, and the README lists a drive mode with drifting, wind sway, time of day, rain and snow for the bundled demo scenes. The part that matters for game work is the export: a 16-direction baked PNG sprite sheet. We read the README and did not run the scripts.

Who it's for

  • Indie and hobby game developers who want rotatable pixel-art props
  • Pixel artists who can draw four views but not model in 3D

Requirements

Requirements

  • Python 3 with Pillow and NumPy (pip install pillow numpy)
  • Node 22.20 or later for the skills CLI install
  • An agent that reads skills: Claude Code, Codex, Cursor, OpenCode, Gemini CLI or Pi

Setup

  1. Step 1

    bash
    npx skills add danielwh2/sprite-stacking
  2. Step 2

    bash
    Add -g for every project, or -a claude-code to pick the agent
  3. Step 3

    bash
    Or copy skills/sprite-stacking into ~/.claude/skills/

مهارة وكيل تحوّل أربع واجهات بكسل آرت (علوية وجانبية وأمامية وخلفية) إلى شرائح مسطحة متراكمة تدور كأنها مجسم ثلاثي الأبعاد، مع سكربت تقطيع وعارض HTML وتصدير 16 اتجاها.

Examples

Ask for a rotatable asset

Prompt
prompt
Make a rotatable pixel art car.

Expected output: One of the README's example requests; if no image generator is available the agent draws the four views itself in a short Python script.

Turn a finished sheet into a turntable

Prompt
prompt
Sprite stack this 4-view sheet and give me a turntable.

Expected output: For when you already have the four views in one row.

Add to a game

Prompt
prompt
Add a fake 3D pixel art tree to my Godot game.

Expected output: The README's example of using the result inside an engine project.

Run the slicer yourself

sh
sh
python3 skills/sprite-stacking/scripts/views_to_slices.py views.png slices.png \
  --slices 36 --preview check.png --html viewer.html

What it does: Cuts views.png into 36 layers, writes a preview and a standalone viewer page.

Pros & cons

Pros

  • Pro:Four plain views are enough input: a voxel survives only where all four views cover it
  • Pro:Writes a standalone viewer with turntable, slice scan, exploded view and a 16-direction sprite-sheet export
  • Pro:Optional normal-map and emissive-mask strips for lighting effects such as headlights and windows
  • Pro:Runs even without an image generator, since the agent can draw the views in code

Cons

  • Con:Needs Python with Pillow and NumPy installed
  • Con:The result is only as good as the four views you or the agent supply
  • Con:Brand new project (created 2026-11-20) with a small test suite that prints ok