Quantizes an ImageData down to a palette of at most maxColors colours plus one index per pixel — the ingredients of an 8-bit PNG and the biggest single PNG size win (the guide's ~75% median saving expectation). quantizeToImageData is the convenience form most callers want.
@dusrel/image-quantize
Colour quantization via the Rust
quantizrcrate (WASM, lazy-loaded): reduce an image to a palette of at most 256 colours plus per-pixel indices — the preparation step behind small palette PNGs. The engine is MIT-licensed quantizr, chosen to replace GPL libimagequant so this package stays MIT (docs/adr/0003 addendum).