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.
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. |