ImageOptim / libimagequant

Palette quantization library that powers pngquant and other PNG optimizers
https://pngquant.org/lib
Other
761 stars 129 forks source link

Could libimagequant be extended to more than 256 colours? #105

Open cmeister2 opened 1 year ago

cmeister2 commented 1 year ago

My use case is that I want to map images into the DMC Colour Chart, which has a palette of around 447 colours in it. Most programs are designed to map into a colour space of 256 colours or less; currently libimagequant appears to be one of those. My question is whether there's an easy path to being able to define a larger colour space without raising errors.

kornelski commented 1 year ago

It can work, but you need to modify the source:

https://github.com/ImageOptim/libimagequant/blob/dc3e6d10ca11dd55744f3e51144ab1306d43d2a9/src/pal.rs#L200-L207