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?"
I went to the doctor only to find out I was color blind and that explained why I could only see three colors on a rainbow. It's sad, I know, but true.
Think nothing is impossible? Try slamming a revolving door.
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"
Have you been able to demonstrate that the small difference seen between two contrasting colors is due to a flaw in the CIELAB model? If so, perhaps you can publish a paper on the subject. Otherwise, what evidence do you have that your program is actually doing the right thing? For example, CIELAB appears to use polar coordinates. Are you sure that you are treating 0 and 2*PI as being the same value?
Also, you have not demonstrated a need for such an evaluation function to exist. Is this because the site designers have a problem being able to choose readable colors? Perhaps if these people cannot select a good color scheme, you need new designers.
Note, IAANR (I am a neurobiology researcher), but I deal mainly with ion channels so take this with an appropriately sized grain of salt:
Your ability to tell the difference between two colors (or light intensities to bring back the classic experiments) depends on how you approach the limit of perception (or differentiation in this case). Classically, if you start where you can not perceive a difference between to intensities, and increase the difference, your threshold for difference will be lower than had you started when you could tell the difference between the two intensities and gradually decreased this difference. It seems that color differences should follow the same rules as light intensities. Also keep in mind that we're more sensitive to differences in shades of blue, IIRC, due to overlaps in the sensitivity ranges of long, medium and short cones. So, these are probably among the causes for you observations.
Automated colour scheme generation. Let's face it, most people (myself included) can't generate a decent colour scheme to save themselves. Having a program create scheme suggestions automatically is extremely useful (blatant plug: check my sig for my own attempt at doing this) for non-artists.
:)
There are a load of tricks for generating colours which usually work well together; however, the hue rotations trick sometimes generates totally unreadable combinations (mainly with bright colours). Having an additional check would be extremely useful.
Anyway, it could be that you're good at graphics, in which case good for you. Just give the rest of us time to catch up
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.
There are a number of critical factors in this process that you haven't told us. The issues of display devices, gamma, and implementation details all play an important role in your ability to visibly distinguish between two colors.
What sort of monitor are you using? Have you correctly callibrated the display? What software are you using to display the colors? How does this software deal with display gamma? Other important details include the brightness of the surrounding environment, other windows and such on the screen which can distract the eye and interfere with your visual processing of the colors.
If you haven't already read the books and web pages by Charles Poynton, they cover all the details. Color issues always seem simple, but actually this is an extremely complex and subtle issue. Also, people's ability to visually distinguish color varies quite a bit. A surprisingly large percentage of the population is color blind to at least some portion of the spectrum. Also, display devices vary widely in their ability to correctly display different colors.
Anyway, to sum it all up, I'd be really surprised if you can use any sort of theory to predict whether you can visually distinguish between different colors. Even with correctly callibrated equipment, and experienced researchers, I doubt that your problem is easily answered!
Best of luck,
Daniel Wexler
www.flarg.com
I did work on this in college for a physics of light and color class. His experiment worked best when he used cyan and red filters for the projectors/cameras. Cyan is the light equivalent of combining blue and green. So in effect, you get RGB, with only taking two black and white samples of a scene.
This is also how 2-chip DLP works. 1-chip DLP uses a color wheel containing RGB, and alterately projects an image of each color, the chip is, in essence, the black and white sample. 2-chip DLP uses a cyan filter on one of the projector's chips, and a red filter on the other, in effect, reproducing Land's experiment! 3-chip DLP uses a chip for each of RGB.
I would recommend making sure you are accounting for the gamma of your monitor in your matricies. That is, your transforms should be, R'G'B'->RGB->XYZ->L*a*b* and then compare. You can also try making comparitions in L*u'v' space, which is also supposed to be "perceptually uniform". You should also generate some gradients in L*a*b* space and see if they match some you might find on the web.
That said, both of these colour spaces are really only approximations, and I think they'll be weighted towards uniformity in pure colours. Maybe a colour that pulls from a wider range of the spectrum like orange or gold might be smaller than the green or blue areas. I'm going to try and generate some test images to verify this either way.
-- MarkusQ
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.
As a sidenote, I'd like to point out that the color yellow can cause sick people to become more ill. Just as red/orange makes someone hungry, bright yellows make someone sick. it can even induce epileptic shock. True! That's why hospitals are always lavender and purple.
Try using the color sum, R+B+G for radius and the ratio of colors for angle. The outside would be white, the center black and a mean radius would have R+B+G = 256 and so contain the pure colors. Limits of acceptable difference could be set to accomodate for any crappy old monitor.
If no one else has come up with this rather obvious aproach to digital color, I hearby delcare first art and grant anyone and everyone the right to use this basic IDEA without further consultation. You'll have to do some work to make that idea practical, but the basic idea seems to have been working for designers, graphic artists, archetects and plain old painters for a long time.
DMCA, Hollings, Palladium. What might have sounded like paranoia is now common sense.
I wrote an image recognition system for the lumber industry a few years back.
:-)
People (graders) using neon chalk would write on boards (The marks would designate the board quality, and where to cut the bad pieces off.) The boards and chalk would go under a housing with UV light, which had a photosensitive trigger. The trigger would signal the computer, to capture the image. The computer would analyze the image, and send out appropiate bits to a PLC which controlled the saws and sorting.
As you have found out, RGB does *not* uniquely identify colors. We worked around that problem in 2 ways:
1) carefully choosing our chalk color.
2) I then converted the colors over to HSB and used a relative error of Hue to determine if 2 colors were "close enough."
It wasn't perfect, but it was close enough and extremely fast.
I doubt HSB will be sufficient for your domain, but see if you can "change the problem" to make it more computer friendly