sprite-gen: How to Set It Up and Make Game Sprites From One Image

By Shah Rukh, software developer · · 8 min read

sprite-gen: How to Set It Up and Make Game Sprites From One Image

sprite-gen is an open-source Python tool that takes one character drawing and turns it into game-ready sprites — a transparent sprite sheet with a data file, or short transparent animation loops. Here’s what it needs, what it actually costs, how to install it, the first commands I’d run, and the things worth sorting out before you start.

Read this first. The sprite-gen code is free, but there’s a catch: it does not ship with an AI image model. To generate anything you have to bring your own paid account — a ChatGPT subscription (through the Codex tool), a SuperGrok subscription, or an API key that’s billed per use. And the project only documents its install commands for a Mac or Linux style terminal. There are no Windows steps.

What sprite-gen actually is

Quick vocabulary, in case you’re new to this. A sprite is a small picture of a game character. A sprite sheet or atlas is one image file holding many poses of that character, so a game engine can flip through them as animation.

Here’s the problem it solves. Ask an AI image model for a sprite sheet directly and, as the project points out, you tend to get a character whose face drifts in every frame, a background that won’t come off cleanly, and poses that don’t line up. sprite-gen exists to fix exactly that. You hand it one base image, and it asks the AI model for a single row of poses at a time, strips out the coloured background, cuts each pose into a clean transparent frame, and assembles the final atlas.

You can use it two ways: as a command-line program (the command is sprite-gen), or as a “skill” that a coding assistant like Codex or Claude runs for you when you ask for sprites in plain words.

Part of the toolWhat goes inWhat comes out
A · atlas rowsOne still image and a list of states (idle, walk and so on)sprite-sheet-alpha.png and manifest.json
B · video to loopOne still imageA transparent GIF, WebP or strip for each motion
C · utilitiesAn image or sheet you already haveClean transparent cut-outs
D · post-processingA finished sheetColour variants and exports for Aseprite, Phaser and Flame
E · asset toolsExisting images or animationsRepeating background tiles, shadows, motion checks

What you’ll need

The install itself only pulls in two Python packages, Pillow and NumPy. No graphics card required — the AI work all happens on the provider’s servers.

Provider nameHow you sign inWhat you pay with
codex (the default)ChatGPT login through the Codex command-line toolYour ChatGPT subscription
grokgrok login, or an XAI_API_KEYYour SuperGrok Imagine quota, or xAI console credit if you use the key
openaiOPENAI_API_KEYBilled per call. It only runs if you name it yourself

The repository doesn’t list prices, so check each provider’s own pricing page before you commit to anything. One nice detail: the tools in groups C, D and E work on images you already have, so they don’t need an AI account at all.

A few things to sort out before you install

  1. Use the real repository. Download only from github.com/aldegad/sprite-gen. It’s an independent project by one developer — not something made by OpenAI, xAI or Anthropic.
  2. Your images leave your computer. The base image and prompts get uploaded to whichever provider you pick, so don’t feed in artwork you’re not allowed to share.
  3. Only use art you have the rights to. Start from your own drawing or one you’re licensed to use, and don’t feed in another game’s characters. It’s also worth reading your provider’s terms on using generated images in a commercial game.
  4. Keep an eye on quota and credit. The gen-set command generates every state row, four at a time, so a single run fires off a lot of requests. The project describes the Grok Imagine quota as a weekly allowance, and if you set an API key, usage is charged to that key.
  5. Keep keys and logins private. The Grok login lives in ~/.grok/auth.json, and sprite-gen only reads it. Your saved choices go in preferences.json inside ~/.config/sprite-gen/; the project says no keys or tokens are saved there. Never put an API key in a file you push to GitHub.
  6. Give each run its own output folder. Point each run at a separate folder and keep a copy of your original image. And if a coding assistant is running the tool for you, read what it plans to do before you approve it.

Installing sprite-gen on Mac

These are the project’s own quickstart commands, and they work on Linux too.

  1. Press Cmd + Space, type Terminal and press Enter.
  2. Download the repository and go into its folder:
    git clone https://github.com/aldegad/sprite-gen
    cd sprite-gen
  3. Create a virtual environment (a private Python folder for this project), switch it on, and install:
    python3 -m venv .venv && source .venv/bin/activate
    pip install -e .
  4. Confirm it works. This prints the list of commands, grouped by the pipelines above:
    sprite-gen --help

The project says this virtual environment is the only supported way to run it. One thing to remember: every time you open a new Terminal window, go back to the folder and run source .venv/bin/activate again before using sprite-gen.

Installing sprite-gen on Windows

There’s no documented Windows path. The quickstart is written for a Mac or Linux shell, and the automated tests run on Linux only. The code does carry some Windows-specific fixes contributed by users, so it might work — but you’re on your own if it doesn’t.

The safer bet is to run the Mac commands above inside a Linux environment on Windows, like WSL. If you try plain Windows anyway, keep in mind that the source .venv/bin/activate line is a Mac and Linux command and won’t work as written.

Installing it as a skill for Codex

If you’re a Codex user, the project gives you a single command to add sprite-gen as a skill:

python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-github.py \
  --repo aldegad/sprite-gen --path . --name sprite-gen

From there you can just ask for sprites or an image. The project says the assistant checks your access, asks only about the choices it’s missing (which provider, which motion method), runs the pipeline and hands back the files.

Making your first sprite atlas

Swap <run> for a new folder name and <id> for a short name for your character.

sprite-gen prepare --out-dir <run> --character-id <id> --base-image base.png
sprite-gen gen-set --run-dir <run> --provider codex
sprite-gen extract --run-dir <run>
sprite-gen compose-atlas --run-dir <run>
  1. prepare sets up the run folder with the request, guides and prompts.
  2. gen-set asks the AI provider for every state row. This is the step that spends your subscription.
  3. extract removes the coloured background and saves transparent frames.
  4. compose-atlas writes sprite-sheet-alpha.png and manifest.json.

There’s an optional fifth command that opens a review page in your browser, where you can compare frames, throw out the bad ones, nudge positions and watch the loop before building the final sheet:

sprite-gen curation --run-dir <run>

That page is served from your own computer at 127.0.0.1 on a free port picked fresh at each launch, so by default it isn’t exposed to other devices.

Features worth knowing about

Keep your expectations grounded, though. The project itself says walk and run cycles stay experimental unless they pass its motion check, and that its left-or-right facing detector can be wrong even when it claims high confidence. Look over the frames yourself.

Updating and uninstalling

There’s no documented update or uninstall command. The one thing the project does spell out: editing the project files doesn’t upgrade a virtual environment that’s already installed, and running pip install -e . again refreshes the sprite-gen command in an older one.

When things go wrong

ProblemWhat to try
sprite-gen is “command not found”The virtual environment is not switched on. Go to the project folder and run source .venv/bin/activate. If the command is still missing, run pip install -e . again.
It stops at start-up and mentions NumPyYou are running it with a different Python. Use the project’s .venv. There is no fallback without NumPy.
The install fails on an old PythonYou need Python 3.11 or newer, with a working venv.
“the grok login token expired”The login lasts about six hours. Run grok models from an empty folder to refresh it, or sign in again with grok login.
Generation is refused because the quota is used upThe tool does not retry. Wait for your allowance to reset or use another provider.
Rows fail with “empty or too sparse”The AI drew a tall image instead of a row of poses. Generate that row again; the project suggests codex follows the layout better.
Saving WebM or MP4 from the review page gives an errorInstall ffmpeg. GIF export works without it.
An error about .sprite-gen.lockAnother sprite-gen process is writing to the same run folder. Wait, or use a different folder.

Heads up: some of the project’s documentation pages are written in Korean, so you may want a translator handy for the deeper guides. The README itself is available in English.

This guide is based on the project’s repository as it was on October 2, 2026 (version 2.17.0, Apache-2.0 licence). The project changes often, so if a step looks different, follow the README on GitHub. ToolsCloset is not connected to the project, or to OpenAI, xAI or Anthropic.

Frequently asked questions

Is sprite-gen free?

The code is free and open source under the Apache-2.0 licence. Generating images isn’t free, though — that runs on your own ChatGPT subscription, SuperGrok subscription or a pay-per-use API key. The cut-out, recolour and export tools work on existing images without any AI account.

Does sprite-gen work on Windows?

There’s no documented Windows installation. The quickstart uses Mac and Linux shell commands and the tests run on Linux. The code does include some Windows fixes from contributors, so it may work, but a Linux environment such as WSL is the safer bet.

Do I need a powerful computer or a GPU?

No. The AI generation all happens on the provider’s servers. On your own machine sprite-gen only needs Python 3.11 or newer with the Pillow and NumPy packages, plus ffmpeg and img2webp if you use the video route.

Which AI providers does sprite-gen support?

Three of them: codex (the default, using a ChatGPT login), grok (using a Grok login or an XAI_API_KEY) and openai (using an OPENAI_API_KEY, billed per call and only used when you name it). The project says other providers aren’t included yet.

What files do I get at the end?

The atlas route gives you sprite-sheet-alpha.png, a transparent sprite sheet, plus manifest.json, which lists the rectangle, speed and loop setting for every frame. The video route gives you a transparent GIF, WebP or strip for each motion.

Can I use the sprites in a commercial game?

The Apache-2.0 licence covers the sprite-gen code, not the images you generate. Rights in generated images come down to your AI provider’s terms and the base image you start from, so stick to your own artwork and read those terms.

Is sprite-gen safe to use?

It’s open source, installs only two well-known Python packages, and its review page listens on 127.0.0.1 by default. The main things to keep in mind are that your images are uploaded to whichever AI provider you choose, and that generation eats into your quota or API credit.

More AI tips

Free Claude Code Setup Guide

Run the Claude Code app with free AI models on Windows or Mac. Full steps, plus the precautions most guides skip.

EmailOSINT Review and Guide

See which accounts, data breaches and stolen-password logs are tied to your email, and what to do about each result.

FastMCP for beginners

Turn a plain Python function into a tool an AI assistant can call. Setup on Windows and Mac, step by step.

Set up Context Mode the easy way

Context Mode is an MCP plugin that stops your coding agent's context window from filling up with raw tool output.

TradingView MCP Guide

Self-host the free TradingView MCP server on Windows or Mac, or pay for hosting — and mind the data-not-advice caveat.

AWS MCP servers, explained

AWS publishes a big set of open-source MCP servers. Here's what they do and how to wire one into your AI coding assistant.

MCP servers in TypeScript

A beginner-friendly look at mcp-use for building and connecting MCP servers, clients and agents in TypeScript.

OpenHands Agent Canvas Guide

Set up the OpenHands control centre for AI coding agents on Windows or Mac, with the safety steps to take first.

Dify Self-Hosting Guide

Run the Dify AI app builder on your own computer with Docker Compose, and know the costs and licence limits first.

LibreChat Docker Setup Guide

Run your own ChatGPT-style chat app on your computer with Docker. Full steps, real costs and safety checks.

🤖

Unity MCP Setup Guide

Let Claude Code, Cursor or Copilot work inside the Unity Editor. Full install steps, plus the precautions to take first.

Logo Design Skill Setup Guide

Add a free logo-design skill to Claude or another AI agent on Windows or Mac, with the precautions to take first.

🤖

Openvid Screen Demo Guide

Record your screen and turn it into a polished demo in the browser, or run Openvid yourself on Windows or Mac.

ReelMimic Setup Guide

Set up ReelMimic to make an original 2D animation in the style of a reference video, with the copyright checks to do first.

Related tools

🖼️

Image to Base64

Convert an image to a Base64 data URI and back.

🧾

CSV to JSON

Convert CSV or spreadsheet data to JSON.

⬇️

Markdown to HTML

Convert Markdown to clean HTML with live preview.