Sunday, June 12, 2016

Color space and the illusion of color

Just as the universe is not bound to the human construct of three dimensions, the universe does not have color. As Peter Gouras states in "Webvision: The organization of the Retina and Visual System":

"Color vision is an illusion created by the interactions of billions of neurons in our brain. There is no color in the external world; it is created by neural programs and projected onto the outer world we see. It is intimately linked to the perception of form where color facilitates detecting borders of objects."
Cones do not see color. Cone opsins merely respond to the chemical reaction of the chromophore pigment. To call the cones red, green, and blue is actually a misnomer. While not completely accurate, the terms Long, Medium, and Short (LMS) are better. The reality is that the three different types of cones respond to three different ranges of wavelengths. This information is relayed via the optic nerve bundle to the left and right visual corti. Information from the left side of the retina goes to the left visual cortex. Conversely, information from the right side of the retina goes to the right cortex. The visual corti assemble the color image.


What are the wavelength ranges for each cone type? It varies depending on the study, and the methodology used to measure the wavelength and sensitivity. While the following diagram appears in a number of color vision articles, the source of the associated study is not given:


A 1995 study by Williams & Cummins show the following wavelength ranges:


Just think, 12% of women are tetrachromatic, but with a different wavelengths for the fourth cone type. The following diagram is from The Neurosphere:

Since a very small percentage of women have a distinctly different curve for the fourth cone type, we can safely use trichromacy for the general population.

As we look at the wavelength curves for each cone type, we can see that the names red, green, and blue are misnomers. The peak receptivity for the Long (red) wavelength cone is closer to yellow than it is to red. The green cone has a peak sensitivity in the dark green wavelengths, while the peak sensitivity for the blue  is closer to violet. The trap is using color models, such as RGB, to define CVD.

Simulation of CVD requires the use of models that reflect the color space of the human eye, or the LMS color space. in 1931, the International Commission on Illumination (CIE) created one of the first mathematical models of the human color space (CIE 1931 color space). This is known as the CIE XYZ color space and is based on the experiments done by William David Wright and John Guild in the late 1920s. Their experiments resulted in the CIE RGB color space. The CIE XYZ color space is a derivative of the CIE RGB color space. The Y component is the luminance. The Z component is quasi-equal to the S cone response, while the X component is a linear combination cone response curves chosen to be non-negative. For any given Y (luminance), the XZ plane will provide all chromaticities at that luminance. It is important to remember that the perceived color depends on the luminance.

From the CIE XYZ color space there are transforms to the LMS color space. Given the complex nature of human color vision, there is not a universally accepted transform. Instead, Chromatic Appearance Models (CAMs) provide Chromatic Adaptation Transform (CAT) matrices. These matrices (M) are the basis of modern simulation models.

The following is a brief summary of the common CAMs. If you are interested in reviewing the actual CAT matrices, you can find them in LMS color space.

  1. CIELAB
    It wasn't until 1976 that CIE released a CAM to replace the many existing, and incompatible, color difference models. CIELAB became the first color appearance model, and became one of the most widely used models. The major weakness of CIELAB is that it performs the von Kries transform before converting to LMS color space. The LLAB CAM was released to correct this error.
  2. Hunt and RLAB CAMs
    Both the Hunt and RLAB CAMs use the Hunt-Pointer-Esteves transformation matrix. Since this matrix was originally used von Kries transform method, it  is also known as the von Kries transform matrix.
  3. CIECAM97s and LLAB CAMs
    Both the CIECAM97s and the LLAB CAMs use the Bradford transformation matrix. With the Bradford transformation matrix, the L and M cone curves are narrower. The narrower curves create a "spectrally sharpened" transformation matrix. The Bradford transformation matrix is also used with the linear von Kries method. There is also a revised CIECAM97s CAM that uses a linear transformation matrix.
  4. CIECAM02
    Released in 2002, the CIECAM02 CAM is a replacement to CIECAM97s. CIECAM02 has better performance and is easier to implement than CIECAM97s. CIECAMO2 comes close to being an internationally agreed upon standard for a comprehensive color appearance model.
  5. ICAM
    Also released in 2002, ICAM was developed by Mark D. Fairchild and Garrett M. Johnson. The goals included simple implementation for images, handling of HDR images, and tone mapping.
The CIE XYZ color space is a virtual space that acts as a reference model for color models. Color models are the subject of the next two articles in this series. These articles provide the necessary background for understanding CVD simulation models, which will be the last article of this series.

Color is an illusion, but it is a fascinating illusion.

Thursday, June 9, 2016

The role of the retina in color vision

With my library still in boxes in the US, I had to spend the day refreshing my old brain cells with information from Wikipedia. In 1913, Sir William Abney published "Researches in Colour Vision and the Trichromatic Theory." After a little over a century, much of what he says remains the same, while there have been dramatic changes in other areas, especially neurology and genetics.

While the names of changed, Sir William Abney defines the eight layers of the retina. What he calls the "peculiar layer"  is the the layer of amacrine cells. The following diagram shows just the retina layer of the eye:


While the rods play an important role in low light conditions (scotopic vision), they have no known role in color vision (photopic vision). The cones require higher luminosity, before they respond. In the above illustration, the cones are divided into the Long (red), Medium (green), and Short (blue) wavelength cones. The ratio of Long:Medium:Short is 40:20:1. While this ratio is a good statistical average, the actual ratio varies across the human population.

The rods and cones are both photoreceptor cells. The shapes of the cells match their names, as seen in the following diagram:


The light sensitive protein lies between the disks in the rods,  and the folds in the cones. In rods the protein is an amino acid chain called rhodopsin. In cones, the amino acid chain is dopsin. The dopsin surrounds the chromophore, which is the pigment that distinguishes color. Most explanations leave out the chromophore, but it is the light filter, not the opsin. It is the chemical reaction in the chromophore that triggers the opsin. Thus, what distinguishes the types of cones is the chemical composition of the chromophore.

Teleost fish, birds, and reptiles are tetrachromatic. These species have cones with chromophore that detect Ultraviolet, Short (blue), Medium (Green), and Long (Red) wavelengths. Placental animals are dichromatic in that their cones detect Medium (Green) and Short (blue) wavelengths. Primates, including humans, developed trichromatic vision. It is possible that gene duplication resulted in a chromophore that detects Long (red) wavelengths. This certainly explains the similarity in their wavelength curves.

For short (blue) wavelength cones the chromophore DNA sequence is on chromosome 7. This placement makes the gene sequence sex independent. The medium (green) and long (red) chromophore DNA sequences appear in contiguous regions on the X chromosome.

The following statement from Hereditary Ocular Disease summarizes the genetic issue for red-green color blindness:

"Red-green color perception is based on gene products called opsins which, combined with their chromophores, respond to photons of specific wavelengths. The OPN1LW and OPN1MW genes reside in a cluster with a head-to-tail configuration on the X chromosome at Xq28. Red-green color vision defects are therefore inherited in an X-linked recessive pattern. There is a single gene for the red cone opsin but there are multiple ones for the green pigment. Only the red gene and the immediately adjacent green pigment gene are expressed. All are under the control of a master switch called the locus control region, LCR.

These DNA segments undergo relatively frequent unequal crossovers which can disrupt the color sensitivity of the gene products so that red-green colorblindness in some form is the most common type of anomalous color vision. It is found in approximately 8% of males and perhaps 0.5% of females."
The same article provides the following definitions:
  • Protanopia - only blue and green cones are functional (1 percent of Caucasian males)
  • Deuteranopia - only blue and red cones are functional (1 percent of Caucasian males)
  • Protanomaly - blue and some green cones are normal plus some anomalous green-like cones (1  percent of Caucasian males)
  • Deuteranomaly - normal blue and some red cones are normal plus some anomalous red-like cones (5 percent of Caucasian males)
My questions are what exactly are the green-like and red-like cones, and how do the alter the response to different wavelengths? Even though there are unanswered questions, the above should help provide a better understanding of the color codes generated in my Colorblind Simulator app.

I leave you with a thought. Just as there are genetic variations that produce the diversity in the physical appearance of the human population, there could be genetic variations in the dopsin structures that determine color vision. Every human eye could be uniquely different. Israeli research has shown that each of us an olfactory fingerprint that is unique to every person. Why not our sense of color?

In 1913, Sir William Abney lived at a time when little was known about neurology and genetics. I enjoy reading old medical books, because they show how much the world has changed in a 100 years. While they didn't know about DNA sequences, they certainly knew about the genetic expression of color blindness.

Sunday, June 5, 2016

Color design for your audience

We use color to communicate a message to our audience. Failure to understand Color Vision Deficiency  (CVD) means that about 9% of our audience doesn't receive the message. This applies to all media, whether it be print, slides, Web pages, games, videos, or smartphone applications. it applies to all communicators, including teachers and graphic designers.

For this article, the focus is on background and text colors. To illustrate the impact of color choices, I used the Text Color activity of my Colorblind Simulator app. Since the True Color standard for RGB supports over a million colors, the colors used are from the Material Design Colors palette for Android. The text color activity, itself, supports all colors. However, copying and pasting from a color palette simplified entry of text colors. The demo uses black as the background color.

The first test used Red 500 as a text color. The following screen capture shows the results for normal vision. A contrast ratio of 4.52, while not high, is above the minimum 0f 4.0. What happens when we look at protanopia (red), deuteranopia (green), tritanopia (blue), and monochromatic vision?

Screen capture of Text Colors with Material Red 500 for text color on Black background.
Individuals with protanopia won't be able to read the text, as the contrast ration is only 1.93, as shown below:

Screen capture of Text colors with Red 500 on black background.

The results for deuteranopia illustrate the problems for those with the most common form of CVD. While the W3C contrast ratio is greater than 3, it is still presents problems for those with poor vision. 

Screen capture of text colors for red 500 for deuteranopia.

Individuals with tritanopia (blue) color blindness have almost the same contrast ratio as normal vision for this color combination. 


While monochromatic vision is vary rare, there are individual for which their world consists of shades of grey. Converting a color to its nearest grayscale value provides an approximation of what they see.

Screen capture of text colors with Material Red 500 as a text color.

Instead of using Material Red 500, the following tests use Material Yellow 500 as the text colors. Starting with normal vision, there is a dramatic improvement in contrast ratio.

Screen capture of text colors with Material Yellow 500 as a text color.
While the contrast ratio drops from 17.20 to 16.74, those with protanopia would not have a problem reading the text.


Screen capture of text colors with the text color of Material Yellow 500.

While deuteranopia (green) color blindness reduces the contrast ratio to 16.19, the text is still easily readable.

Screen capture of text colors with Material Yellow 500

Although individuals do not see the color as yellow, a contrast ratio of 15.03 makes the text easily readable.

Screen capture of text colors with Material Yellow 500.

With a contrast ratio of 16.52, even individuals with monochromatic vision can easily read the text.

Screen capture of text colors with Material Yellow 500.
As long as color does not carry special information, using colors for background and text colors is not an issue. What color an individual sees is not an issue. The issue is having a contrast ratio that makes the text easy to read. While the W3C guidelines define 3.0 as a minimum value, contrast ratios above 7.0 are much easier to read. White background and black text produce the highest contrast ratio of 21. Some individuals have a problem reading text with very high contrast ratios. To reach the maximum number of members in an audience, I recommend a contrast ratio between 7 and 18.

To accommodate visually impaired individuals, color cannot be the sole carrier of information. Graphs and bar charts need to be labeled, along with a detailed verbal description. Graphs can use different line types. These techniques do not preclude the use of color, they just provide alternate methods of communication. Afterall, the ultimate goal is effective communication to an audience.