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

10 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. Perceptually equal color spaces by Joe+Decker · · Score: 5, Insightful
    None of the standard Photoshop, et al color spaces is designed to produce perceptual equivalence, perception is just too complex.

    In addition, it sounds like you're hoping to test whether things are sufficiently perceptually different on people's monitors. The sad news is that the variation between different monitors, between LCDs and CRTs, between different brightness and contrast settings, between different phosphor technologies, differences in how long the monitor has been warmed up, and differences in the aging of the phosphors mean that no two monitors will actually produce the same color from the same R, G and B equivalents, and you'll get different distinguishabilities for different colors on different monitors.

    As a nature photographer, I have to jump through hoops, including hardware sensors for detecting the output of my monitor, to get anything like reproducable color out of my own equipment. It's just a difficult problem, I'm afraid.

  3. Try the Value in HSV instead by "Zow" · · Score: 4, Interesting

    I think the key in picking colours for any website is that they have have a difference of at least X in brightness (the V in Hue-Saturation-Value unless I'm sadly mistaken - I'm not an expert in this area), where you should be able to determine X experimentally. Any decent color picker (such as those in Gimp or Photoshop) will allow you to jump between RGB or HSV. The reason I think this is the way to go is that a decently large percentage of the population (at any age) is colour blind, so while you or I may easily be able to see the difference between a blue and green, or a green and red, at the same brightness, some people (particularly males), just can't.

    That should take care of you for making the site usable. At that point, the choice of which light or dark colors you use for what becomes purely stylistic (again, I'm just a stupid computer scientist - I'm sure someone with a stronger HUI, marketing, or fine arts background might have a stronger opinion on what colors are used for what).

    -"Zow"

    1. Re:Try the Value in HSV instead by sfraggle · · Score: 5, Interesting

      I have to agree with this. I am the author of Text Mode Doom and I hit a problem along these lines during development: the RGB value itself is not particularly useful when trying to find a numerical value for a particular "colour" that the human eye perceives. In text mode doom I was faced with the problem of mapping the particular colour value to a corresponding text colour, of which I was limited to a small value (under 16). I solved the problem by converting the RGB values into HSV and then assigning text colours to the real colours based on their hue. The results I found with this were quite impressive

      --
      were you expecting to see a sig here? perhaps you'd rather see the inside of an ambulance!
  4. Land's Two Color visual perception work by mbone · · Score: 4, Interesting

    Edwin Land (yes, the founder of Polaroid) did work in human color perception, where he showed that two colors could used to create an apparent full color image.

    The important things are our visual expectations, as well as the relative intensity of parts of the scene. I can remember a demo from Land where two projectors sufficed to give a full color scene. If part of the image was abstracted, it appeared to be black and white ! This implies that a combination of two colors can, under certain circumstances, appear to be the same as a different combination of three colors. I would suspect that this effect would have to be considered in the vision tests described in the original posts.

    A Michigan State U. report on the Land work is available, as is a lot of more recent work, such as this paper by Kobus Barnard.

  5. 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."
  6. Why not ask the kids? by MarkusQ · · Score: 4, Interesting
    Why not ask the kids? Make it a game of some sort (details depending on age) where they have to find and click on some target word or image. Track how often (or how quickly) each combination is picked, and you'll have all the data you need to answer your question. To keep from wasting time in the parts of colour space where you know the answers (yes, navy blue text shows up well on a pale pink background) have the game advance through levels (each level having less distinction than the one before) until they have three wrong clicks/timeouts. Then start over with another base colour pair.

    -- MarkusQ

  7. Re:Color blindness by BWJones · · Score: 4, Interesting

    Yeah so this was interesting as there have been tetrachromats discovered in other primates (monkeys other than humans), so it was reasoned that it might be possible to find tetrachromacy in humans.

    The advantage that hyperdimensional color perception has over traditional trichromacy it a better ability to discriminate hues or different colors. Therefore a tetrachromat could be considered to be at a certain advantage when it comes to color discrimination. This obviously has not been important to our evolution but it is for some species as birds and turtles see a world we can only imagine with some birds seeing from ultraviolet into the visible spectrum and turtles seeing a world rich with color. For instance, if you were to imagine a turtle sitting in a pond with the water as still as glass and the sun setting on the horizon making everything (the sky, land and water) red and orange and yellow, the turtle sitting in the water would be able to pick out a frog sitting on a log with discrimination that we could never hope to approach.

    --
    Visit Jonesblog and say hello.
  8. 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!

  9. 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)