canon_init
Generates a sprite-canon.json config file that sets palette, regions, scale, and check thresholds for sprite projects. Learns the palette from sample images, filtering rare noise colors.
Instructions
Create sprite-canon.json for a project: the single source of truth for palette, regions, scale and check thresholds. Learns the palette from sample images (colours used at least minCount times; rarer colours are usually anti-aliasing noise). Run once per project, then commit the file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | Yes | project directory to create sprite-canon.json in | |
| name | No | project name | |
| cellH | No | spritesheet cell height (PNG sheets only) | |
| cellW | No | spritesheet cell width (PNG sheets only) | |
| minCount | No | min occurrences for a colour to enter the palette (default 4) | |
| sampleFiles | No | PNG/GIF files or directories to learn the palette from | |
| updatePalette | No | relearn just the palette of an EXISTING canon from sampleFiles (regions/scale/checks untouched) |