0x0funky/agent-sprite-forge
Agent Skill for generating 2D sprite sheets and map, transparent PNG frames, and animated GIFs from prompts.
About 0x0funky/agent-sprite-forge
0x0funky/agent-sprite-forge is an open-source project on GitHub, mainly written in Python. Agent Skill for generating 2D sprite sheets and map, transparent PNG frames, and animated GIFs from prompts. It currently holds 5,746 stars and 559 forks with 14 open issues, and was last pushed on 2026-11-13 (repository created 2026-04-23).
Project Overview
Git Homed tracks it on the Today's Trending board, currently at rank #70 with 39 new stars today.
GitHub Repository Details
README
Agent Sprite Forge
Languages: English | 繁體中文 | 简体中文 | 日本語 | 한국어
0.4 launch teaser: every frame is real ASF output.
One still → a whole game-ready sprite set
Approve one generated still. Get every action of the character, keyed, looped, timed and exported for your engine.
Agent skills for Claude Code (plugin), Codex and Grok. The agent generates a master still with the best image route you have, makes one image-to-video clip per action from it, and deterministic Python tools gate, key, register, loop, retime, finish and package every action for Godot, Aseprite or a web game.
|
1. One approved master still Generated by the local Codex CLI ( image_gen), take 1 of 3.
|
2. Six actions, one image-to-video clip each Grok image-to-video (local CLI), soft-matte keyed, registered, loops picked by measurement, one-shots retimed to game speed, HD finish with the colour lock. Real timing. |
3. In a scene: the packaged run, attack and idle over a generated background. The run speed is measured from the contact foot, so the feet do not slide. Every frame comes from the 2026-10-06 live run; nothing is mocked up.
Pixel looks · Hibit style · What's new · Quickstart · Routes and providers · Pipeline · Maps · Showcase · Tools
New: pixel looks, 1x sprites that follow a reference
A whole fight from pixel-look sprites, rendered at 1x and shown at 2x: four 1x characters (masters of 33x55 to 87x86) and 14 sets with 168 drawings read back from image-to-video clips. The plate behind them is a generated painting brought down to 384x216 and 40 colours. The white hit flashes and the knight's fade are the demo's; nothing else is added.
An image model asked for pixel art paints a picture of pixels: blocks of uneven size (15 to 30 px in the picture below), 88,410 colours in one small figure, soft edges. Shrinking it does not help: resized plainly to the sprite's size it still has 1,033 colours. Hibit gets round this by never asking for pixel art. Pixel looks go the other way, for the classic small sprite that follows a look you like: the look is never described in words, one sprite you like is the reference for the whole cast, and the picture the model paints is read back onto a real grid. pixel_look.py master finds the picture's own grid, takes one flat colour from every block, keeps the figure's proportions, brings the colours down to a palette and closes the outline by rule. What comes out can be counted: 33x55 pixels, 48 colours, alpha 0 or 255, a 2.5 KB PNG.
|
What the image model painted 1254x1254 px. The figure alone has 88,410 colours and its blocks are 15 to 30 px: no grid fits it. |
Resized plainly to 33x55 Nearest sampling, shown at 7x: 1,033 colours, the ground's green left in 3 cells. Bilinear gives 1,275 colours and 413 soft pixels. |
pixel_look.py master
The same picture read on its own grid, shown at 7x: 33x55, 48 colours, no soft pixel. |
The same part of the face: the picture at 2x (left) and the sprite at 40x (right).
The cast follows the first sprite. Every further character is drawn beside the first sprite in one picture (ask-cast, cast), so it keeps the pixel size and stands as tall: a mage, a skeleton knight and a frost dragon, 48 colours each.
Poses, views and motion from the master. A pose is the master reproduced with one change (the sword pose: 217 cells changed, 91% of the master kept); a view is drawn beside the master. Motion comes from an image-to-video clip of that sprite: pixel_motion.py reads every frame back on the sprite's lattice and palette (the attack: 21 drawings picked from 145 video frames). The number is the drawings of each set.
| Measured on the run (2026-11-12) | |
|---|---:|
| The swordsman's generated picture (the figure) | 1254x1254, 88,410 colours, blocks 15-30 px |
| The same picture resized to 33x55: nearest / bilinear | 1,033 colours / 1,275 colours and 413 soft pixels |
| pixel_look.py master | 33x55, 48 colours, 0 soft pixels, 2.5 KB |
| The cast: mage / skeleton knight / frost dragon | 45x56 / 50x55 / 87x86, 48 colours each |
| The sword pose from the master | 217 cells changed, 91% of the master kept |
| The attack set from one clip | 21 drawings from 145 video frames |
| The fight | 14 sets, 168 drawings; every drawing has only its sprite's own colours and no soft pixel |
What's new:
pixel_look.py(generate2dsprite):ask-masterandmasterdraw the figure you like again, alone and large, and read it as the 1x master;ask-castandcastdraw every further character beside the master;ask-pose,pose,ask-viewandviewmake poses and side or back views from the master;lineupputs everything on one ground line and reports the heights.pixel_motion.py(video2dsprite):prepare,frames,finish,measure,breath: the frames of an image-to-video clip read back on the sprite's lattice and palette, a loop or an action picked from them, and ananimation.json3.0 package with nearest sampling.- Only on request. Nothing else changes: the HD, pixel and hibit finishes and their defaults are untouched.
- The reference sets the look (pixel size, shading, outline); the characters are your own. The whole route, what you accept and when, and its limits: references/pixel-looks.md.
New: hibit, real pixel art from flat AI art
Pip's Star Grove, a one-screen demo built only from hibit output: autopilot gameplay captured from the game canvas (480x270, shown at 2x). FX: pixelfx by Patch (MIT).
Never ask an image model for "pixel art": it paints fake, uneven pixels. The hibit style asks it for clean flat lineless art (at most 3 tones per material, no outlines) and makes the pixels afterwards: one palette per character learned from the source pixels, an 8x8 majority-vote downscale (every pixel is the palette colour that covered most of its cell, never a blend), hysteresis against flicker, eyes and glints kept, binary alpha, and a 1 px outline whose colour comes from the sprite itself.
|
Flat art in, pixel art out The approved master (Codex) and the hibit finish of the idle at 80 px: 16 colours learned from the source plus the outline colour, which --outline auto takes from the sprite's dominant hue (#380500, a deep red-brown from the orange fur). Never a fixed orange.
|
Whole sets, one palette per character Pip (idle, walk, cast, hurt) and a magma slime (idle, crawl, attack): Grok image-to-video clips through sprite_set.py --finish hibit, 12 fps. Every action reuses the first action's palette and outline.
|
FX: pixelfx (recommended) or the image route
For hibit effects we recommend pixelfx by Patch: a library of code-driven pixel-art effects (fire, arcane, impacts, weather, pickups, UI) that fits the style and renders for free on your machine. It is a separate MIT project: clone it yourself (git clone https://github.com/patch-gg/pixelfx, Node 18+) and the skill finds it. fx_pixelfx.py check picks the route; a route you name wins.
| | A: pixelfx installed (recommended) | B: image route (always available) |
|---|---|---|
| Frames per effect | 16-91 at 30 fps | 4 (one 2x2 sheet) |
| Cost | free (local Node) | one generated image per effect |
| Look | pixelfx's own style, recoloured with --ramp and --snap | your game's flat style and palette |
| Credit | every render ships CREDITS.txt (pixelfx's MIT license and notice) | the image route, like every sprite |
|
A: pixelfx arcane/star-fall recoloured to Pip's palette, impacts/hit-spark, spawn/poof, spawn/coin-drop.
|
B: image route Codex 2x2 FX sheets, keyed and registered by process, made pixel art by the hibit_fx.py step (Pip's palette for the stars and coins, 6 learned colours for the spark and the poof).
|
Full 50 s of autopilot play, same seed: with pixelfx FX (MP4) · with image-route FX (MP4).
| Measured on the live run (2026-11-06) | | |---|---:| | Pip: palette (learned from the source pixels) | 16 + outline | | Noise flicker removed by the hysteresis (vs the same majority without it): Pip's 4 clips / the slime's 3 | 32-40% / 10-24% | | Auto outline colour: Pip / magma slime / Forge Bot | #380500 / #380500 / #002131 | | Colours in the whole game scene: route B / route A (pixelfx light blending; only the star-fall snapped) | 65 / about 6,700 | | Frames per effect: route B / route A | 4 / 16-91 |
What's new:
master_still.py --finish hibit: masters as flat lineless cel-shaded art, the input the hibit finish wants.finish_frames.py hibitandsprite_set.py plan --finish hibit: the palette, the 8x8 majority-vote downscale, hysteresis, lone-pixel cleanup and the outline (auto, a#RRGGBB,selective,darkornone); 80 px heroes, 12 fps, nearest sampling in the engine export.hibit_plate.py(generate2dmap): 480x270 backgrounds (x4 = 1080p) with a 14-colour palette, a paper-cut smoothing pass and shade maps for lighting and hit flashes without new colours.fx_pixelfx.py(check,list,render) for route A andhibit_fx.py pixelizefor route B.
Forge Bot: the earlier bold pixel finish, then hibit with the outline from the image (auto), the palette's shades (selective) and a fixed studio orange.
What's new in 0.4 — the big upgrade
Before 0.4, character animation meant cutting frames out of an image-generated sheet, or keying a single clip by hand. 0.4 turns one approved still into the whole set: one image-to-video clip per action, and a measured pipeline from every clip to the engine. Before and after, measured on real outputs:
|
Pixel finish: the 48x64 fox run Old: one image-gen sheet cut 1/8 (594–709 colours per frame, soft alpha). New: master still → Grok clip → pixel finish (16–19 colours, binary alpha, selective outline). 4x nearest, both at 80 ms. |
Soft-matte keyer: no purple fringe Same Grok clip, same frame, 2x crop. Fringe 0.704 → 0, leaked key pixels 7,780 → 0, keying 271 s → 44 s for 145 frames. |
|
One-shots retimed to game speed Image-to-video plays a quick attack as a slow-motion clip. retime --auto-oneshot cuts the frozen holds and pins the hit: 4.1 s → 0.7 s, hit at 292 ms.
|
HD colour lock Video models drift colours on fast limbs. The lock holds every design colour on the master's (OKLab chroma, lightness kept): hue flips halve and most of the boot shimmer goes away. |
| Measured on the live runs | before | 0.4 | |---|---:|---:| | Pixel fox (48x64, 8 frames): colours per frame | 594–709 | 16–19 | | Pixel fox: alpha levels | 199 | 2 | | Pixel fox: lone pixels per frame (mean) | 732 | 75 | | Keyer: purple fringe (outer-ring spill, mean) | 0.704 | 0 | | Keyer: key pixels leaked over 145 frames | 7,780 | 0 | | Keyer: time for 145 frames | 271 s | 44 s | | Attack: one-shot length | 4.1 s | 0.7 s | | Colour lock: hue flips per frame pair (run loop) | 352 | 170 | | QC: good takes wrongly rejected | 18 of 24 | 0 of 24 |
What changed:
- Image generation first. Every image and clip goes through one command,
route_media.py: your API key if you configured one (OpenAI, Google Gemini, xAI, BytePlus, fal.ai), else your signed-in Codex or Grok CLI, else code art as the last resort. See Routes and providers. - One master still per character.
master_still.pywrites the prompt, generates takes, fixes a near-miss by edit and approves one still (master.json). - A whole set from that still.
sprite_set.pymakes one image-to-video clip per action, gates every take (area, feet, identity, zoom, turning around, edges, background, extra objects, motion, end pose, colour bleed, timing), retakes with fix clauses, keys with a soft matte, registers, picks loops, retimes one-shots, finishes and packages. - HD finish by default, crisp pixel finish on request. One body scale per character from the master. The pixel finish adds a crisp downscale, a spaced palette of at most 32 colours, a selective outline and binary alpha.
- Colour lock on every action of a set, and QC recalibrated on 42 labelled live takes.
- Engine exports. animation.json 3.0 with a PNG atlas, VP9-alpha WebM and packed-alpha MP4, decoded and verified; Godot SpriteFrames and Sprite3D; Aseprite JSON; maps for Tiled, Godot and LDtk.
- Claude Code plugin, plus Codex and Grok installs. Hardened on Windows: Codex sandbox run folders, locked-file cleanup, cp1252/cp950 consoles.
Quickstart
1. Install
Claude Code (plugin)
claude plugin marketplace add 0x0funky/agent-sprite-forge --sparse .claude-plugin skills
claude plugin install agent-sprite-forge@agent-sprite-forge
python -m pip install "numpy>=1.26" "Pillow>=10.1" "scipy>=1.11"
--sparse checks out only the plugin manifest and the skills, not the showcase media.
Codex
git clone https://github.com/0x0funky/agent-sprite-forge.git
cd agent-sprite-forge
python -m pip install -r requirements.txt
python tools/install_skills.py --apply --host codex
Grok: from the same clone, python tools/install_skills.py --apply --host grok (~/.grok/skills). --host agents writes ~/.agents/skills and --dest any skills folder.
--apply backs up an installed copy and writes a sha256 manifest; python tools/install_skills.py --check --host codex reports drift later. Video needs ffmpeg 5.1+ on PATH. Start a new agent session so the skills load.
Optional: configure an API key (Setting API keys). Without one, the agent uses your signed-in Codex or Grok CLI.
2. Make the master still
Use $generate2dsprite to make a master still of Aria, a young swordswoman hero: short dark hair, a teal hooded cloak, a long red scarf and one steel sword. Side view, facing right, HD.
The agent runs master_still.py generate --takes 3 (every take through route_media.py), shows you the takes, fixes a near-miss with master_still.py edit ("THE ONLY CHANGE: ..."), and approves one: the still is keyed, padded to the class framing (a hero stands 788 px tall on 1024x1024) and recorded in master.json.
3. Make the sprite set
Use $video2dsprite to animate the approved Aria master: idle, walk, run, attack, jump and hurt. Package them for Godot and the web.
Under the hood (` is the installed video2dsprite` folder):
python "/scripts/sprite_set.py" plan --master art/aria-master/master.json --output-dir art/aria-set
python "/scripts/sprite_set.py" run --plan art/aria-set/set_plan.json
python "/scripts/sprite_set.py" review --plan art/aria-set/set_plan.json
python "/scripts/sprite_set.py" accept --plan art/aria-set/set_plan.json --action run --take 2
python "/scripts/sprite_set.py" report --plan art/aria-set/set_plan.json
run resumes where it stopped and never generates a clip twice. The agent looks at every review sheet before it accepts an action, because the numbers cannot see a changed weapon or a covered face. Each action ends as a verified package; export_engine.py adds Godot and Aseprite files.
Routes and providers
Every generated image or clip goes through generate2dmedia/scripts/route_media.py. It walks this order and names the route it used:
| Order | Route | Images | Video | Used when |
|---|---|---|---|---|
| 1 | API: a key you configured | OpenAI, Google Gemini, xAI, BytePlus Seedream, fal.ai (reference edits) | xAI, BytePlus Seedance, fal.ai (Kling v3, Veo 3.1, Luma, MiniMax, Wan, Vidu, LTX) | A key is configured. The key is your consent, so there is no per-call question |
| 2 | Local CLI: your own signed-in Codex or Grok | Codex image_gen (up to 8 references); Grok one-shot image or edit | Grok image-to-video in ACP mode (6 or 10 s) | No key, or every API route refused for an account reason (no key, auth, quota, rate limit). Uses your subscription quota, never an API key |
| 3 | Code art (codeart2d) | Code-drawn pixel sprites, vector art, FX, tiles | Rigged animation | The last resort: only when no route exists (no-route, exit 3) or when you ask for code-drawn art. Always disclosed as code-drawn |
python "/scripts/route_media.py" resolve --kind image prints the route that would run, and forge_doctor.py lists which keys are configured (yes or no, never the key) and the resolved order. A moderation refusal, or an outcome that may have cost money, is never