Sprite FusionSprite Fusion
Pixel Art GeneratorAPI

Color Palettes

Generate and transform sprites with preset, saved, or one-off palettes and manage your palette library.

Use palette on generate, edit, style-reference, and direction-set to restrict colors: every result uses only the palette's colors. Animations keep the colors of their input sprite and don't accept a palette.

Generate with a palette

Supply exactly one source:

SourceExample
One-off colors{"colors":["#182818","#486840","#F0E8C0"]}
Built-in preset{"preset":"pico-8"}
Saved palette{"id":"pal_…"}

Generate a forest knight using three colors:

{
  "operation": "generate",
  "prompt": "A forest knight",
  "size": 32,
  "palette": {"colors": ["#182818", "#486840", "#F0E8C0"]}
}

One-off colors apply to the request without saving a palette. Use 2–256 different six-digit RGB hex strings, with or without #. Colors are normalized to lowercase with #, keep their order, and duplicates are removed. Named colors, three-digit shorthand, and alpha hex values are not accepted. An invalid palette returns 400 with the invalid_palette code; an unknown id or preset returns 404 with palette_not_found.

Omit palette for unrestricted colors.

Each sprite made with a palette includes palette: {colors, paletteId?}. Renaming or deleting a saved palette doesn't change it.

Keep a sprite's palette

When the input of an edit or direction-set is the asset_id of a sprite made with a palette, the results keep that palette: no palette field is needed. A style-reference keeps it when every input shares the same palette.

A palette in the request replaces the sprite's palette, and "palette": null drops it.

Palettes aren't detected from images. To keep the original colors of any other sprite, such as one you drew or imported, pass its colors as palette:

{
  "operation": "direction-set",
  "inputs": [{"upload_id": "upl_hero"}],
  "palette": {"colors": ["#1a1c2c", "#5d275d", "#b13e53", "#ef7d57"]}
}

Manage saved palettes

These endpoints use the same Bearer authentication as generation and are free. Saved palettes are private to your account and shared between the web app, the API, and the MCP server, whose list_palettes, save_palette, rename_palette, and delete_palette tools do the same.

EndpointBodyResult
GET /api/v1/palettes—{"palettes":[…],"presets":[…]}
POST /api/v1/palettes{"name":"Forest","colors":["#182818","#F0E8C0"]}201, {"palette":{…}}
GET /api/v1/palettes/{id}—{"palette":{…}}
PATCH /api/v1/palettes/{id}{"name":"Forest at dusk"}{"palette":{…}}
DELETE /api/v1/palettes/{id}—{"deleted":true}

Saved palettes have id, name, colors, createdAt, and updatedAt. Presets have preset, name, author, and colors. Use the returned preset value to generate with a built-in palette.

Names must be 1–80 characters after trimming; requests are limited to 16 KiB. To change a palette's colors, save a new one.

You can save up to 1,000 palettes. Past that, POST /api/v1/palettes returns 409 with the palette_limit_reached code; delete a palette to save another.

Need Help?

On this page