Skip to content

By PromptFission2 min read

An agent skill carves fake-3D game sprites out of four flat pixel-art drawings

sprite-stacking intersects top, side, front, and back views into a voxel block, slices it, and spins the layers. Its skill file is mostly a list of ways that goes wrong.


Sprite stacking is an old indie game trick: draw an object as a pile of flat horizontal slices, rotate each slice, and offset each one by a pixel so the pile reads as 3D. sprite-stacking, by Daniel White (danielwh2 on GitHub), is an agent skill that gets a coding agent to produce those slices from four ordinary 2D views. The README says the technique was not invented here. What the project adds is the carving step and the workflow around it.

How it works

The input is one image with four orthographic views in a row: top, side, front, and back. The skill file gives the agent three ways to get it. Use an image generation tool with a fixed prompt that demands zero perspective and zero anti-aliasing. Use a sheet the user supplies. Or, with neither, draw the views in a Python script with Pillow at native resolution and upscale 8x with nearest-neighbour filtering.

A Python script then carves. It treats the views as silhouettes of a block of voxels and keeps only what all of them agree on. The README’s rule:

“a voxel survives only where all four views cover it.”

The surviving volume is cut into a strip of layers, ground layer first. To draw it, each layer is rotated, squashed vertically to fake camera pitch, and lifted one pixel above the last. The skill suggests 15 to 20 slices for chunky sprites and 32 to 48 for detailed ones.

Silhouette carving has known blind spots, and the skill is direct about them. Round parts carve square unless you pass a --round flag. A cavity that none of the four silhouettes can see gets filled in solid. Parts one pixel wide flicker as the stack turns, so the slicer prints a warning and the skill says to draw them at least two pixels wide. The skill ends with a table of such lessons, each with a fix: off-center objects orbit, rounding the rotation center the wrong way makes the sprite wobble, and spheres come out egg-shaped unless their height is corrected for the squash.

There is also a gate. Before any game code is written, the agent must open a check sheet showing the four views, four turntable angles, and an exploded view, and regenerate bad input instead of patching it.

The slicer can also write a standalone HTML viewer with a turntable, an exploded view, and an export to a 16-direction sprite sheet. The skill carries render-loop notes for web Canvas, Godot, Unity, and Phaser.

Try it yourself

npx skills add danielwh2/sprite-stacking installs it for Claude Code, Codex, Cursor, OpenCode, Gemini CLI, or Pi. According to the README that route needs Node 22.20 or later, and the slicer needs Python 3 with Pillow and NumPy. The license is MIT. The commit history starts on November 20.

We have not run the skill or the slicer. This is based on the README, the skill file, and the commit history.