XadillaX / thmclrx

:art: A theme color extractor module for Node.js.
http://blog.xcoder.in/thmclrx-stress-tester/result/
MIT License
204 stars 21 forks source link

Lab instead of RGB? #3

Closed Santinell closed 7 years ago

Santinell commented 9 years ago

What do you think about change for better search color space from RGB to Lab or LCH? I am not profi, but in CIE76 (color diff. algorithm) using euclidian distance in Lab color space. In CIE94 used LCH color space.

XadillaX commented 9 years ago

Sry, I don't know those algorithms.

I will add learn CIE76 into my TODO list and write a CIE76 version of thmclrx.

But in octree algorithm, the calculation is using RGB color space.

Santinell commented 9 years ago

As I know octree algorithm can be used for searching nearest neighbor in 3-dimensional space. Lab is also has 3 dimensions

XadillaX commented 9 years ago

@Santinell But in reducing colors, octree algorithm using R, G and B these three dimensions.

Santinell commented 9 years ago

http://en.wikipedia.org/wiki/Color_quantization#Algorithms "The three color channels are usually red, green, and blue, but another popular choice is the Lab color space, in which Euclidean distance is more consistent with perceptual difference."

XadillaX commented 9 years ago

@Santinell Thx very much. I will read that for further. And would you please to improve this package together?