quantize_to_palette
Snaps each pixel to the nearest color in the sprite's palette, making existing art conform to a new palette.
Instructions
Snap every pixel to the nearest color in the sprite's palette.
Walks the chosen cels and replaces each opaque pixel with the closest palette color (RGB distance). Run after apply_palette_preset or set_palette to make existing art conform to the palette.
Args: filename: Aseprite file to modify layer_name: Layer to quantize (empty = all top-level layers) start_frame: First frame to process (default 1) end_frame: Last frame to process (default 0 = last frame)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| layer_name | No | ||
| start_frame | No | ||
| end_frame | No |