Skip to main content

AI 2D & pixel art

Buril's 2D pipeline targets pixel art, sprite sheets, and tile sets specifically — the domain where AI tools have caught up to (and occasionally exceeded) hand-craft for production-acceptable output. The pipeline composes:

  • PixelLab — the leading per-sprite AI provider, wired via pixellab-mcp.
  • SpriteCook — sprite sheet and tile set generation.
  • Aseprite — the industry-standard pixel editor, wired via pixel-mcp (an OSS MCP server we've absorbed and extended).
  • Local stable-diffusion-pixel pipeline — ControlNet-driven SD generation tuned for low-res pixel output.

Tool families:

FamilyWhat
pixel_*Aseprite bridge, palette ops, dithering, sprite sheets
pixellab_*PixelLab cloud (BYOK)
spritecook_*SpriteCook cloud (BYOK)
pixelgen_sd_*Local stable-diffusion-pixel pipeline (via ComfyUI)

Total: ~45 tools.

The pipelines

A. Generate a single sprite

Generate a 32x32 pixel-art knight sprite, idle pose, and save to
Assets/Sprites/Knight_Idle.png.

The pixel-cook specialist picks the provider (PixelLab cloud by default if a key is wired; SD-local otherwise):

  1. pixellab_generate --prompt "knight" --resolution 32x32 --view idle
  2. pixel_palette_constrain --max_colors 16
  3. pixel_export_png --path Assets/Sprites/Knight_Idle.png

Total time: 5-15 seconds.

B. Generate a sprite sheet

Generate a 4-direction walk-cycle sprite sheet for the knight, 32x32, 8 frames per direction.
spritecook_generate
prompt: "knight, pixel art"
resolution: 32x32
views: ["north", "south", "east", "west"]
frames_per_view: 8
output: Assets/Sprites/Knight_Walk.png

SpriteCook returns a single PNG with 32 sprite frames arranged in a grid, plus an Aseprite-compatible .aseprite source.

C. Generate a tile set

Generate a 16x16 dungeon tile set: walls, floor, doors, stairs, water.
spritecook_tileset_generate
prompt: "fantasy dungeon"
resolution: 16x16
categories: [wall, floor, door, stairs, water]
output: Assets/Tiles/Dungeon/

Returns one PNG per category plus a Unity Tilemap-ready Asset bundle. The pixel_unity_tilemap_assemble post-step wires the tiles into a TilePalette.

D. Edit in Aseprite (round-trip)

Open the knight sprite in Aseprite, add a sword in the right hand, and bring it back.

The pixel-cook specialist:

  1. pixel_aseprite_open --path Assets/Sprites/Knight_Idle.png
  2. pixel_aseprite_apply_brush --target "right_hand_anchor" --brush sword_short
  3. pixel_aseprite_save
  4. pixel_aseprite_export_png --path Assets/Sprites/Knight_Idle.png

Aseprite must be installed locally. The bridge talks to Aseprite over its scripting API via the pixel-mcp MCP server.

Installing pixel-mcp

Python 3.11+:

pip install pixel-mcp

Register in Buril:

Tools → Buril → MCP Hub → Register External → Type: pixel-mcp

pixel-mcp is OSS — Buril ships extensions on top in Tools~/pixel-mcp-buril/. See Third-party licenses for attribution.

PixelLab vs. SpriteCook vs. SD-local

NeedUse
One-off sprite, fast and on-brandPixelLab (best per-sprite quality)
Animated sprite sheet (walk, attack, etc.)SpriteCook (sheet-aware)
Large tile sets and biomesSpriteCook (tileset mode)
Offline, no API budgetSD-local (Stable Diffusion via ComfyUI)

Palette enforcement

AI providers occasionally output 256-color RGBA where you wanted 16 colors. The pixel_palette_constrain tool snaps any input to a palette:

{
"tool": "pixel_palette_constrain",
"input": {
"path": "Assets/Sprites/Knight_Idle.png",
"palette": "endesga-32",
"dither_mode": "ordered"
}
}

Bundled palettes include endesga-32, pico-8, nes-54, gameboy-pocket-4, pixel-perfect-32. You can supply a custom palette as a JSON array of hex codes.

Animation export

Aseprite's tags + frame durations are preserved through the round-trip. Export to:

  • Sprite sheet PNG + JSON metadata (TexturePacker format) — pixel_export_sheet.
  • Unity AnimationClips per Aseprite tag — pixel_export_unity_clips.
  • GIF for prototyping — pixel_export_gif.

Common issues

SymptomFix
Generated sprite looks blurryResolution was too low; AI upsamples. Set explicit resolution.
Walk cycle frames inconsistentSpriteCook uses a per-frame prompt — set consistency_anchor to the first frame's hash.
Tilemap edges don't tileRun pixel_make_seamless on each tile category.
Aseprite bridge fails to connectpixel-mcp server not running. Re-register in MCP Hub.