Slashdot Mirror


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?"

4 of 199 comments (clear)

  1. Read this relevant document by saforrest · · Score: 5, Informative

    A friend of mine wrote a paper on this topic:

    Limitations of Colour Management.

  2. Some useful links... by Hal-9001 · · Score: 5, Informative
    ...for people who are wondering what this is all about:
    • 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."
  3. Colour Differences. by Anonymous Coward · · Score: 4, Informative

    There are several things that you need to know:

    1) People are generally MUCH less sensitive
    to differences in BLUE than in RED and
    somewhat less sensitive to RED than to GREEN.

    2) Gamma correction is poorly implemented across
    the web - that results in great differences
    in the percieved colours for the brightest
    and dimmest R, G or B values. This is hard
    to cope with.

    3) Don't forget colourblind people! This can
    result in people finding it hard to distinguish
    various colour values depending on the nature
    of their disability.

    4) Women see subtle differences between greenish
    blues MUCH better than men.

    5) The CIE cromaticity diagram includes a bunch
    of colours that a CRT cannot reproduce.

    6) How distinguishable two colours are depends
    critically on the backgrounds against which
    they are presented and how close they are to
    each other in space and time.

    7) In the real world, colours can be pure,
    single frequences of light - or complex
    chords with many, many frequencies. A CRT
    can only display light of three frequencies,
    so most pure colours and even most mixtures
    of colours can't possibly be accurately
    depicted. Fortunately, human eyes can
    only *measure* the light intensity at
    three basic frequencies - so CRT's appear
    to work acceptably. However, the frequencies
    of light generated by the phosphors in a CRT
    or the LCD's in a flatpanel are not the
    same exact frequencies that the human eye
    detects. That results in a lot of strange
    non-linearities.

    8) The colours produced by a particular RGB
    triplet will be different on CRT, LCD,
    printer ink, etc. That can make a huge
    difference in readability.

    CONCLUSION:
    ~~~~~~~~~~~

    You have a LOT of research to do!

  4. Re:difficult problem with much research by Wavicle · · Score: 5, Informative

    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)