3 ms·
Instead of returning the mean rgb values, a better idea is to cluster the colors (e.g. using mean-shift algorithm) in a perceptually uniform color space [2] (su
by porphyra 6y ago
Instead of returning the mean rgb values, a better idea is to cluster the colors (e.g. using mean-shift algorithm) in a perceptually uniform color space [2] (such as CIELAB).
[1] https://en.wikipedia.org/wiki/Mean_shift https://en.wikipedia.org/wiki/Mean_shift
[2] https://programmingdesignsystems.com/color/perceptually-uniform-color-spaces/ https://programmingdesignsystems.com/color/perceptually-unif...
- dqpb 6y agoYes, this would be much better. Additionally it could return a pallet of N colors instead of just one.
- Techonomicon 6y agoUsing a better algorithm makes sense, though a single color seems to be the point of the "product" in this case.
- davycro 6y agoNeat suggestion. I too am seeing shades of brown for most queries. Maybe this would help.
- dsamarin 6y agoI heartily agree. For example, searching kiwi should result in roughly the color of the inside part. Instead it's a light muted green, probably taking into account a white background that it's usually featured on. Taking the mode by clustering instead of the mean would improve results.
- mkasu 6y agoThere's a paper which does something similar including an analysis of different statistical models on top of a CIELAB color space. Estimating Color-Concept Associations from Image Statistics. Ragini Rathore et al., IEEE VIS InfoVis 2019. https://arxiv.org/pdf/1908.00220.pdf https://arxiv.org/pdf/1908.00220.pdf
- jansan 6y agoAgreed. A flower should not be represented by a brown color.
- mattnedrich 6y agoI wrote a tool that explores different ways to cluster in the RGB space - https://github.com/mattnedrich/palette-maker https://github.com/mattnedrich/palette-maker It compares k-means, median-cut, and simple RGB space quantization. mean-shift is great, but it is unbelievably slow (n^2)
- porphyra 6y agoI thought you can make mean shift go faster with the Fast Multipole Method. See: https://home.cscamm.umd.edu/programs/fam04/fgt_duraiswami_fam04.pdf https://home.cscamm.umd.edu/programs/fam04/fgt_duraiswami_fa... (PDF file)