extract_palette
Extract an optimal color palette from a sprite using native quantization, up to a set color limit. Writes the palette to the RGB sprite and returns the hex colors.
Instructions
Build an OPTIMAL palette from the sprite via native ColorQuantization.
True palette extraction (vs the nearest-snap quantize_to_palette): writes the resulting palette to the sprite and returns it. NOTE: mutates the sprite's palette. Sprite must be in RGB mode.
Args: filename: Aseprite file to modify max_colors: palette size cap, 1..256 (fewer if the art has fewer) with_alpha: include alpha when quantizing
Returns: JSON {colors: [#RRGGBB, ...], count}
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filename": "<filename>"
},
"name": "extract_palette"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| max_colors | No | ||
| with_alpha | No |