sprite_repaint
Recolor a canon sprite region onto a dark-to-light color ramp deterministically, preserving shading and silhouette. Use it to create consistent color variants instead of regenerating the image.
Instructions
Deterministically recolour a canon region onto a colour ramp (dark→light hex list) — the alternative to regenerating with AI and losing consistency. Shading survives (luminance maps onto the ramp using the region's FIXED recorded range), silhouettes never change, protected regions are never touched, and the same input always gives the same output. Use maskFromFile when repainting an already-recoloured variant: regions are matched on the original (identical pixel layout), paint is applied to the variant. Writes to outFile (never overwrites the input unless outFile equals it).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| ramp | Yes | hex colours dark→light, e.g. ['4a3418','7a5628','a8813c','cfae6b'] | |
| rows | No | restrict painting to this row range [from,to] | |
| cellH | No | spritesheet cell height (PNG sheets only) | |
| cellW | No | spritesheet cell width (PNG sheets only) | |
| region | Yes | canon region to repaint | |
| outFile | Yes | ||
| canonPath | No | path to sprite-canon.json (default: search upward from the target file) | |
| maskFromFile | No | match the region on this file instead (same pixel layout) |