danielwh2/sprite-stacking
GamesAn agent skill that carves four pixel-art views into rotatable fake-3D sprite stacks with a viewer.
This repo is an agent skill pack · 1 skillsSkill list and install →What it does
Sprite stacking is a long-standing indie technique: a 2D image is split into thin layers and each layer is drawn slightly offset as the camera rotates, creating a fake-3D object from pixel art. This repository packages that workflow as an agent skill, so a coding agent such as Claude Code, Codex, Cursor, OpenCode, Gemini CLI or Pi can turn four orthographic views (top, side, front, back) into slice strips and a spinning turntable.
The core step is carving: a voxel is kept only where all four views agree it is covered, which keeps the result consistent with the source sheet. The volume is then cut into flat layers and rendered with rotation, pitch squash and a one-pixel lift per layer. The repository ships the slicer script plus a standalone HTML viewer.
Quick start
You need Python 3 with Pillow and NumPy. Install the skill into the current project with the skills CLI (Node 22.20+):
npx skills add danielwh2/sprite-stacking
Alternatively, copy skills/sprite-stacking into your agent's skills folder: ~/.claude/skills/ for Claude Code, or ~/.agents/skills/ for Codex, Cursor, OpenCode, Gemini CLI and Pi. Then ask your agent something like "Sprite stack this 4-view sheet and give me a turntable."
To run the slicer directly on a four-view sheet:
python3 skills/sprite-stacking/scripts/views_to_slices.py views.png slices.png \
--slices 36 --preview check.png --html viewer.html
This writes the slice strip, a preview image and a standalone viewer page. If you don't have a four-view sheet, the README notes the agent can draw the views itself in a short Python script.
Options that matter
--slices Nsets layer count; roughly 15-20 for chunky sprites and 32-48 for detailed ones.--order readingforces the TOP, SIDE, FRONT, BACK order; by default views are matched by proportion.--roundmakes towers, balloons and pots carve round instead of square.--side-nose righttells the slicer the side view faces right.--colours Nsets a shared palette size;0keeps every colour.--normalsand--emissiveexport a matching normal-map strip and an auto-detected emissive mask strip.
The generated viewer includes turntable, scene, slice-scan, exploded and play modes, plus time-of-day lighting, weather and 16-direction baked sprite-sheet export. skills/sprite-stacking/scripts/viewer.html also opens on its own and accepts dropped slice strips.
Constraints
This is an agent skill plus a Python script, not a standalone game engine plugin. The slicer requires Python 3, Pillow and NumPy; the npx skills add route needs Node 22.20 or newer. Input views are expected as four orthographic views in one row, and the default view matching relies on proportions, so unusual sheets may need --order reading. Performance figures quoted for the viewer are for Chrome and come from the project's own description rather than an independent benchmark. The project is MIT licensed.
HotRepo's take
In HotRepo's new-project snapshot for 2026-11-21, the repository was recorded at 107 stars and 12 forks, with that growth reported over the window from 2026-11-20 to the next day. No all-language daily rank was recorded for it. The narrow point of the project — four-view carving plus an agent workflow — is what separates it from general sprite-stacking demos, and the bundled slicer, CLI options and viewer give the skill something concrete to operate rather than a prompt-only wrapper.
Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.
You might also like
- Hugo-Dz/spritefusion-sprite-normalsGenerates normal maps from pixel art sprites and sprite sheets so 2D game art can react to dynamic lighting.
- 0x0funky/agent-sprite-forgeTurns one approved AI still into gated, looped, game-ready 2D sprite sets and maps via coding agents.
- patch-gg/pixelfxA code-based pixel art VFX library of 244 effects for browser games and engines, with a Claude Code skill for authoring new ones.
- kociden/sakurai-skillA Claude Code skill distilling game design principles from 257 Sakurai videos into review and planning guidance.
- op7418/guizang-game-skillA Claude Code/Codex skill that guides AI agents through building a playable 3D browser action game.