extract_palette
Extracts the unique colors used in a sprite or image and returns them as a #RRGGBBAA list, optionally applying them as the file's palette.
Instructions
Extract the unique colours used in a sprite (or another image).
Args:
from_image: Optional image/sprite to scan instead of `filename`.
set_as_palette: Apply the extracted colours as `filename`'s palette.
include_alpha: Treat differing alpha as distinct colours (default off).
max_colors: Error out if more unique colours than this are found.
Returns the list of "#RRGGBBAA" colours found.
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 | ||
| from_image | No | ||
| max_colors | No | Default: 256. | |
| include_alpha | No | Default: false. | |
| set_as_palette | No | Default: true. |