alexwlchan / dominant_colours

A CLI tool to find the dominant colours in an image 🎨
https://dominant-colours.glitch.me
MIT License
89 stars 4 forks source link

Add an option for “smart” selection of palette size #24

Open alexwlchan opened 1 year ago

alexwlchan commented 1 year ago

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.

alexwlchan commented 1 year ago

Further assorted thoughts: