1. I don't have a suggestion for an algorithm, but if its not too much work to integrate the kind of existing algorithms ai mentioned, why not add multiple algorithms and give us some choice in the UI? that would be pretty cool ive got to say
MTPaint is a good(?) example of a program that does this.
It offers the following options;
* Number of colours
* Color matching:
* Colorspace:
* RGB
* sRGB
* LXN [note: similar to LAB. I have no idea why they felt they had to implement this instead.]
* Difference measure:
* Largest (Linf)
* Sum (L1)
* Euclidean (L2)
* Reduce color bleed:
* Gamut
* Weakly
* Strongly
* Serpentine scan
* Error propagation % [note: only applies to FS dithers AFAIK; used to reduce 'noisiness']
* Selective error propagation: Off | Separate/Split | Separate/Sum | Length/Sum | Length/Split
* [X] Full Error precision
* Method of deriving palette:
* Exact
* Current palette
* PNN Quantize (slow, better quality)
* Wu Quantize (fast)
* Min-Max quantize (best for small pictures and dithering)
* Dithering:
* None
* Floyd-steinberg
* Floyd-steinberg (quick)
* Stucki
* Dithered (effect)
* Scattered (effect)
To me, this is an example of what not to do -- overwhelm the user with a huge array of options, rather than hardcoding many settings to generally-sensible values. However, it does illustrate the breadth of the problem domain, and the program itself could also serve as a tool for you, @rizer, to figure out exactly what color reduction algorithm is best for you to implement in Pixaki.