SpriteSheetGen

v0.3.0
io.github.terror668/spritesheetgen Checked 4 days ago Published 13 days ago

AI sprite sheets for 2D games: generate a character, animate it, export PNG, JSON and Godot files.

AI sprite sheet generator for 2D games, as an MCP server and a CLI. Describe a character, animate it (walk, run, idle, attack, jump), and get engine-ready files in your project folder: a sprite sheet PNG, a TexturePacker JSON atlas, a Godot 4 SpriteFrames resource, single frames and a GIF preview. Free browser tools: video to sprite sheet, GIF to sprite sheet, sprite sheet maker, cutter, sprite sheet to GIF Paste this into Claude Code, Codex or another agent with MCP:

Summary extracted from the README.

SpriteSheetGen

English · 简体中文 · 日本語 · 한국어

npm

AI sprite sheet generator for 2D games, as an MCP server and a CLI. Describe a character, animate it (walk, run, idle, attack, jump), and get engine-ready files in your project folder: a sprite sheet PNG, a TexturePacker JSON atlas, a Godot 4 SpriteFrames resource, single frames and a GIF preview.

Product: spritesheetgen.com · Docs: terror668.github.io/spritesheetgen

Free browser tools: video to sprite sheet, GIF to sprite sheet, sprite sheet maker, cutter, sprite sheet to GIF

Quick start with an AI agent

Paste this into Claude Code, Codex or another agent with MCP:

Set up SpriteSheetGen for me: follow https://spritesheetgen.com/agents/install.txt

The agent installs the MCP server and the agent skill. You then create an API key on https://spritesheetgen.com/account/ and store it in your own terminal (it is typed hidden, never pasted into the chat):

npx -y @spritesheetgen/cli login

Add the MCP server by hand

# Claude Code
claude mcp add spritesheetgen -s user -- npx -y @spritesheetgen/cli mcp

# Codex
codex mcp add spritesheetgen -- npx -y @spritesheetgen/cli mcp

Claude Desktop, Cursor, Windsurf and other clients that read an mcpServers file (examples/mcp.json):

{
  "mcpServers": {
    "spritesheetgen": {
      "command": "npx",
      "args": ["-y", "@spritesheetgen/cli", "mcp"]
    }
  }
}

Node.js 20 or newer. The server runs over stdio and reads the key saved by login (or SPRITESHEETGEN_API_KEY), so logging in later needs no restart.

Tools

Tool Credits What it does
estimate_sprite free Price of a character or an action, your balance and the key's remaining budget
improve_prompt free (small daily quota) Turns a rough idea into a character description that generates well
create_character paid One character image from a description
upload_character free Uses your own PNG, JPEG or WebP character instead
animate_character paid One animation of a character: walk, run, idle, attack or jump
get_generation free Status and result of a generation (can wait for it)
list_characters free Characters you generated or uploaded
list_actions free Animations a character already has, so you never pay twice
export_sprite_sheet free Packs a finished animation (or a local GIF) into a folder on your machine

An agent always estimates first, shows you the price and spends only after you approve it. Every paid call carries a max_credits cap and a client_key, so a retried request is never charged twice.

API keys and spending limits

Keys are created on the account page. Each key has its own permissions and a daily and total credit cap; a new key cannot spend until you allow it. The key is stored in ~/.config/spritesheetgen/credentials (%APPDATA% on Windows), readable only by you; logout removes it.

New accounts receive 25 credits. Current prices are on the pricing page; the estimate tool always returns the live price.

CLI

The same features without MCP:

npx -y @spritesheetgen/cli --help

spritesheetgen estimate --description "a small beetle knight" --json
spritesheetgen character --description "a small beetle knight" --client-key my-unique-key-0001 --max-credits 5 --json
spritesheetgen animate --reference generation:CHARACTER_ID --action walk --client-key my-unique-key-0002 --max-credits 10 --json
spritesheetgen export --id ANIMATION_ID --out ./assets/beetle-walk --name walk --individual-frames --preview --json

Exporting a GIF you already have needs no key and costs nothing:

npx -y @spritesheetgen/cli export --file ./walk.gif --out ./assets/walk --name hero_walk --preview

What an export contains

See samples/little-knight-walk: the knight's walk on a green screen, packed by the CLI (background removed, edges cleaned, frames aligned).

File Use it in
sheet.png Any engine: frames in a row (or a grid), transparent background
sheet.json Phaser, PixiJS and other engines that read TexturePacker JSON (hash), with an animations block
animation.tres Godot 4: a SpriteFrames resource for AnimatedSprite2D, with speed and looping set
preview.gif A quick look
export.json The settings used, to repeat the export
frames/*.png, frames.zip Unity, GameMaker or any tool that wants single images (--individual-frames)

Phaser 3:

this.load.atlas("knight", "sheet.png", "sheet.json");
this.anims.create({ key: "walk", frames: this.anims.generateFrameNames("knight", { prefix: "knight_walk_", end: 11, zeroPad: 2 }), frameRate: 14, repeat: -1 });

Godot 4: put sheet.png and animation.tres in the same folder, then drag animation.tres onto an AnimatedSprite2D's Sprite Frames.

Source code

src/ is the source of the @spritesheetgen/cli package on npm: the command line, the MCP server and the sprite pipeline that packs sheets on your machine (background removal, edge cleanup, frame alignment, pixel-art mode, PNG/JSON/Godot export). Generation runs on spritesheetgen.com; this code calls its API with your key.

npm ci
npm test          # unit tests, no network
npm run build     # dist/index.js, one self-contained file
node dist/index.js mcp

A Dockerfile runs the MCP server over stdio. Mount your project at /work, where exports are written:

docker build -t spritesheetgen .
docker run -i --rm -e SPRITESHEETGEN_API_KEY -v "$PWD:/work" --user "$(id -u):$(id -g)" spritesheetgen

About this repository

The code here is copied from our main codebase at each release, so pull requests are read and applied there by hand. Questions and bug reports are welcome in issues or at support@spritesheetgen.com.

Released under the MIT license.