extract_palette
Extract unique colours from a sprite or image to create or update its palette. Supports alpha inclusion and max color limits.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| from_image | No | ||
| max_colors | No | ||
| include_alpha | No | ||
| set_as_palette | No |