0x0funky /agent-sprite-forge

Agent Skill for generating 2D sprite sheets and map, transparent PNG frames, and animated GIFs from prompts.

★ 5,755⑂ 560👁 18⑃ 9● 8▤ 2
PythonMITCreated 2026-04-23
下载:v0.6.0 — Real AI pixel game sprites: pixel looks and hibitv0.6.0 ↓0.6.02026-11-13
+14
日增长
5,755
stars
560
forks
18
watchers
9
prs
8
issues
2
releases

README

Agent Sprite Forge

语言:English | 繁體中文 | 简体中文 | 日本語 | 한국어


  



  



  
  
  0.4 宣传预告:每一帧都是 ASF 的真实输出。


 本页是与英文版同步的摘要。完整说明以 English README 为准(繁體中文为完整翻译)。

 一张原画 → 整套可进游戏的 sprite

面向 Claude Code(插件)、Codex 与 Grok 的 agent 技能。Agent 用你手上最好的生图路径做出一张原画(master still),再从这张原画为每个动作各生成一段图生视频(image-to-video),然后由确定性的 Python 工具逐一把关、抠图、对位、挑循环、重新计时、后期处理(finish)并打包,交给 Godot、Aseprite 或网页游戏。


  
  
  
  
  一张原画(本机 Codex CLI 生成)→ 每个动作一段 Grok 图生视频 → 六个动作。每一帧都来自 2026-10-06 的实机运行。


 新功能:pixel looks,照着一张参考图做出 1x 像素小人


  
  
  这场战斗的角色和动作都是 pixel looks 的产出,以 1x 渲染、2 倍显示:四个 1x 角色(母图 33x55 到 87x86)、14 组动作共 168 张图(从图生视频读回来)。后面的背景是一张生成的图,缩成 384x216、40 色。白色的受击闪光和骷髅骑士的淡出是 demo 加的。


让图像模型画“像素画”,它画出来的是一张“长得像像素”的图:方块大小不一(15 到 30 px)、一个小角色就有 88,410 种颜色、边缘发糊;直接缩小到 sprite 的尺寸,还是有 1,033 种颜色。hibit 的做法是根本不让模型画像素;pixel looks 反过来,专门做“照着你喜欢的风格”的经典像素小人:风格不用文字描述,由一张你喜欢的 sprite 作为整组角色的参考,再把模型画的图读回真正的网格:找出图里自己的网格、每个方块取一个平涂色、保留角色比例、把颜色收敛成调色板、按规则封闭描边。结果数得出来:33x55 格、48 色、alpha 只有 0 或 255。


  
  
  
  
  左:模型画的图(1254x1254,角色本身 88,410 色)。中:直接缩成 33x55(1,033 色)。右:pixel_look.py master(33x55、48 色、没有半透明像素)。


- pixel_look.py(generate2dsprite):ask-master / master 做出 1x 母图;ask-cast / cast 让其他角色站在母图旁边画,像素大小与身高一致;ask-pose / pose、ask-view / view 从母图做出姿势与侧面、背面;lineup 核对身高。
- pixel_motion.py(video2dsprite):prepare、frames、finish、measure、breath:把图生视频的每一帧读回 sprite 的网格与调色板(攻击:从 145 帧视频挑出 21 张),导出 nearest 采样的 animation.json 3.0。
- 需要你指定才会运行。其他都不变:HD、像素、hibit 三种后期及其默认值没有改动。参考图只决定风格,角色必须是你自己的。详见 English README 与 references/pixel-looks.md。

 新功能:hibit,把平涂 AI 图变成真正的像素画


  
  
  Pip's Star Grove:完全用 hibit 产出做的单画面小游戏,自动驾驶实机游玩(原生 480x270,2 倍显示)。特效:Patch 制作的 pixelfx(MIT)。


不要让图像模型画“像素画”。hibit 风格让模型画干净的平涂无线稿图,像素在后期才产生:每个角色从原始像素学一套调色板,8x8 多数决缩图(绝不混色),迟滞(hysteresis)压闪烁,保留眼睛,二值 alpha,再加一圈颜色取自角色本身的 1 px 描边(--outline auto,不会固定用橙色)。


  
  


- master_still.py --finish hibit:平涂无线稿原画。finish_frames.py hibit / sprite_set.py plan --finish hibit:调色板、多数决缩图、迟滞与描边(80 px、12 fps)。hibit_plate.py:480x270 背景,14 色,附 shade map。
- 特效两条路径(fx_pixelfx.py check 自动选择,你指定的优先):A:推荐 Patch 制作的 pixelfx(独立 MIT 项目,请自行 git clone,需要 Node 18+;每个特效 16-91 帧、免费,render 附 CREDITS.txt);B:生图路径(2x2 特效 sheet → process --scale-strategy registered → hibit_fx.py pixelize,每个特效 4 帧,风格与配色和游戏一致)。


  
  
  
  左:A(pixelfx);右:B(生图)。完整 50 秒游玩:pixelfx 版 MP4 · 生图版 MP4。详见 English README。


 0.4 新功能:大升级

| 实机测量 | 升级前 | 0.4 |
|---|---:|---:|
| 像素狐狸(48x64,8 帧):每帧颜色数 | 594–709 | 16–19 |
| 像素狐狸:alpha 阶数 / 每帧孤立像素(平均) | 199 / 732 | 2 / 75 |
| 抠图:紫边(外圈溢色,平均) | 0.704 | 0 |
| 抠图:145 帧中漏出的 key 像素 / 用时 | 7,780 / 271 秒 | 0 / 44 秒 |
| 攻击:单次动作长度 | 4.1 秒 | 0.7 秒 |
| 颜色锁定:每对相邻帧的色相翻转(跑步循环) | 352 | 170 |
| QC:被误判淘汰的好 take | 24 段中 18 段 | 24 段中 0 段 |

- 生图优先: 所有图片和视频都经过 route_media.py:已配置的 API key(OpenAI、Google Gemini、xAI、BytePlus、fal.ai)→ 你已登录的本机 Codex / Grok CLI → 最后才是代码绘制(codeart2d)。
- 一张原画: master_still.py 生成候选、用编辑修正、核准为 master.json。
- 整套动作: sprite_set.py 为每个动作生成一段视频,自动 QC 与重拍、soft matte 抠图(无紫边)、对位、自动挑循环、单次动作自动重新计时、HD 颜色锁定,默认 HD 后期,可选清晰的像素后期,并导出引擎文件。
- 引擎导出: animation.json 3.0、PNG atlas、We

Top issues

Latest release

v0.6.0 — Real AI pixel game sprites: pixel looks and hibit v0.6.0 2026-11-13
Real AI pixel game sprites: pixel looks and hibit

Ask an image model for pixel art and it paints a picture of pixels: blocks of uneven size, 88,410 colours in one small figure, soft edges. This release gives your agent two ways to real pixel art, in Claude Code, Codex and Grok:

- Pixel looks (new in 0.6.0): classic small sprites that follow a reference. The picture the model paints is read back onto a real grid.
- Hibit (0.5.0, announced here for the first time): high-bit pixel art. The model paints only a flat, lineless master and the Forge computes every pixel.

▶ Watch the update video (a

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON