extract_palette
Extract an optimal palette from an RGB sprite via color quantization, limiting colors and controlling alpha inclusion, then write the palette to the sprite.
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}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| max_colors | No | ||
| with_alpha | No |