User:Chinasaur/Imaginary colors

Imaginary colors: not my forte but it's good for my education to try to explain it, so I'll give it a shot. The canon is the textbook Color Science (and more recent variations) by Wyszecki and Stiles. I don't know what your background is, so forgive me my pedagogy.

If you check out International Commission on Illumination, you'll see the CIE 1931 representation of human perceivable color space (for the "standard observer"). The short story on imaginary colors is simply that anything outside the horseshoe shape is an imaginary stimulus; you can assign it coordinates in the color coordinates system, but it cannot actually be evoked in the human eye; it's "bluer than blue" or "redder than red", etc. This is a pretty trivial point; the more interesting question is "why would we care about imaginary stimuli?".

If you take a second look at the CIE diagram, you can tell immediately that this is an important question; look at the axes that the horseshoe shape is plotted on. These are not axes of real primary colors; the point 0,0 in the CIE x,y system is outside the range of perceivable colors. Weird! Why would the CIE parameterize their color space based on imaginary axes?

Okay, here's where primaries come in: as you can see at gamut, no three primaries are going to define a gamut triangle that covers the entire horseshoe of possible human perceivable colors. This often comes as a surprise to math types since the human visual system is based at the input level on a set of three detectors. It seems like if we could just pick one light spectrum that stimulates only the blue cone, one spectrum for red, and one spectrum for green, then of course we could stimulate the cones in any combination and thus produce any possible perceivable color; since the human color system starts with a parameterization of light spectra into three variables, shouldn't we need only three different primary stimuli to cover the entire space? The problem is that there is no spectrum that stimulates only the green cone, so it isn't possible to get the necessary three pure basis functions for generating all possible greens.

You can see this from the cone response functions in the plot at right. This plot shows the response amplitudes of the three cone types to pure monochromatic light stimuli of varying wavelengths. As you move along the x-axis, you are stimulating with different pure wavelengths (basically going through the rainbow spectrum from indigo to deep red). If you think about it, you can see that there is a problem in the area around 500-600 nm. For the red and blue primaries it's a no-brainer; you pick wavelengths at the extremes of the spectrum that only stimulate these cones individually, giving you maximal linear combinatorial flexibility. But what are you going to pick for your green primary color? Something around 500, where you get mostly green response, followed by red, followed by blue, or something around 600 where you get red response followed by green response? If you pick 500 for green primary, then you won't be able to recreate 600 with your three primaries because you won't have any way of getting green without adding blue, which you don't want for 600. If you pick 600 for your green primary, you won't be able to recreate 500, because your green primary always has too much red in it.

As a math type, you could probably state this as a linear algebra, dependent systems sort of conflict (in fact, if you can do this off the cuff, I'd like to hear how you'd describe it), but I'm not gonna get into that :). What the visually minded (myself) can see is that on the horseshoe CIE diagram, the greens problem reads out really nicely as the impossibility to cover the horseshoe with a (contained) triangle; you can cover the red and blue ends of the space pretty well with the corners of a triangle, but because of the bulge around the green perimeter, you aren't gonna be able to do justice to that area of the spectrum no matter what primary (triangle corner) you pick there.

In practical color science, there are ways to get experimental measurements defining only the green cone response. For example, you pick a green primary at 600 and then ask how much red must be subtracted from the stimulus in order to recreate 500. How this subtraction is calculated practically has to do with color matching experiments and we don't need to get into it. The point is, now we can cover the entire perceivable color space with RGB primaries, it just requires negative primary coefficients sometimes. This is ugly, but it's functional, so one version of the CIE horseshoe shape is actually plotted on RGB coordinates with part of the visible area extending into the negative coordinates (mostly for R but a little bit for G too).

However, the negative numbers are ugly, and make calculations harder (in turn making color technology more computationally demanding). Therefore, the standard CIE horseshoe is plotted on XYZ coordinates, a linear transformation of RGB that moves the visible area out of the negative ranges. So the XYZ coordinates are a transformation of real RGB primaries into more convenient, imaginary primaries.

Whew, that was a lot longer than I expected. Hopefully it was helpful. Let me know if you have more questions. Maybe a discussion like this will eventually become an article... So little time...