Determining Color Difference Using the CIELAB Model?
Colour Blind asks: "I am working for a not-for-profit organization developing a website for kids. I am attempting to develop a method for testing if two colours (as defined by R, G, and B values [0-255]) are adequately different to be visible on top of each other. So far I have tried many things but this is the one that, by all accounts, should work: I have converted from RGB to (CIE)XYZ using a 3x3 matrix transformation. From here I have used three more equations to convert to CIELAB colour. I have then calculated the distance between the two colours in question in CIELAB colour space. The results are not correct: there are pairs of colours that are quite far from visible that yield the same difference as colours that are plainly acceptable for visibility. Any suggestions?"
A friend of mine wrote a paper on this topic:
Limitations of Colour Management.
- The CIE color space: A pretty decent introduction to what the CIE color space is
- Color FAQ: I haven't read through this, but it seems to be a more extensive coverage of color and how it's much more than RGB, HSV, or CYMK.
The short version is that all the different primary color systems--RGB (red-green-blue), CYMK (cyan-yellow-magenta-black), HSV (hue-saturation-value)--can represent some, but not all, of the colors visible to the human eye. Even specifying colors by the wavelength of the light emitted or reflected covers only a small subset of colors--in fact an even smaller subset than any of the primary color representations. The CIE system identifies colors by an XYZ coordinate system, where X, Y, and Z are artificial primary colors that span the full range of colors visible to the human eye."It take 9 months to bear a child, no matter how many women you assign to the job."
Hear hear!
This is a complex problem and I think a lot of the answers I'm reading on this topic center around a misconception on a lot of people's part about the difference in luminance perception and chrominance perception. The key issue is:
The eye is most sensitive to luminance changes in GREEN.
The eye is most sensitive to chrominance changes in BLUE.
Thus if you are trying to determine at what point the eye will say "hey there is a block of a different color on top of that one", blue is going to be an important part of your color model since while your eye isn't so good at picking up how bright a blue is, it is very sensitive to the relative shade around the blue wavelength something is.
So if you are trying to do a 3-space transform and distance and finding that colors which are linearly close to each other in CIELAB space are perceptually very different, it is very likely because it is a color in a space where the human eye is more perceptually sensitive. You are going to get "dead areas" of the model where the eye is not so good at viewing differences, and active areas where in a small space there seem to be quite a few different colors because the eye is perceptually sensitive in that area.
This is the reason you see odd patterns in color changes in a rainbow. You are seeing the relative sensitivities of your eye to pick up colors. Color perception is decidely non-linear and doesn't even fit a nice equation.
Education is a better safeguard of liberty than a standing army.
Edward Everett (1794 - 1865)