Currently the tool asks you to specify the max number of colours you want returned in the dominant palette.
This is occasionally useful (e.g. if you need a fixed size palette) but other times it’s annoying because it forces you to pick the size of your palette. Picking this size is tricky, and it varies by image! Too few colours, and distinct values get smushed into one. Too many colours, and certain values will get split arbitrarily.
It might be useful to have some way of picking palette size based on a configurable threshold, e.g. keep adding colours until there are two colours whose vectors are <0.01 apart – i.e. let the tool pick the “best” palette size within some limit.
There should be some default upper bound (e.g. 25) to avoid the tool running away with itself, both in runtime and return values. A very varied image might have lots of dominant colours!
Maybe this can reuse the existing --max-colours flag? That flag is already a clue to the tool, not a requirement – it can return less than the max if it’s a very simple image.
What’s the right metric for “distance” in colour space? Probably not RGB.
Currently the tool asks you to specify the max number of colours you want returned in the dominant palette.
This is occasionally useful (e.g. if you need a fixed size palette) but other times it’s annoying because it forces you to pick the size of your palette. Picking this size is tricky, and it varies by image! Too few colours, and distinct values get smushed into one. Too many colours, and certain values will get split arbitrarily.
It might be useful to have some way of picking palette size based on a configurable threshold, e.g. keep adding colours until there are two colours whose vectors are
<0.01
apart – i.e. let the tool pick the “best” palette size within some limit.