lokesh / color-thief

Grab the color palette from an image using just Javascript. Works in the browser and in Node.
https://lokeshdhakar.com/projects/color-thief/
MIT License
12.34k stars 1.31k forks source link

color-thief detects wrong color #218

Open spidercode opened 2 years ago

spidercode commented 2 years ago

Hi,

I have this sample code that detects color using color-thief

https://jsfiddle.net/spidercode/k6Lumq8y/1/

when I run this, it detects the color which is different in the shade. The color which I am expecting ( RGB(0, 150, 209) ) is not being detected by color-thief.

image

I might be doing something wrong. But couldn't figure it out.

LuccaGarcia commented 2 years ago

I had a similar issue a while ago, when trying to detect the dominant color of an image the value returned would always be a little off, unfortunately I couldn't find a solution that would not involve rewriting the entire code.

It's sad but apparently color-thief is no longer actively maintained.

benjaminvanrenterghem commented 2 years ago

It's a problem caused by its core dependency, quantize, which produces the wrong result.