# Why is there a difference between the CIE XYZ colour gamut vs CIE RGB?

Yet another question about colour space...

In my research on CIE XYZ system, I found that it is based on the CIE RGB colour matching experiments, and that because the RGB system needed occasional negative values, XYZ was developed in order to have an entirely non-negative system. From this I infer that the x(), y() and z() colour matching functions are just transformations of the original r(), g() and b() functions, using exactly the same data. I also found online that the XYZ and RGB systems were completely interchangeable, and XYZ is just preferred for the lack of any negative components.

If that is incorrect please correct me!

However, if they are interchangeable and based off of the same data, why is it that Wikipedia's comparison of the two spaces shows a marked difference? Is the missing curvy section outside of that inner triangle just the areas where the CIE RGB system would have to be negative?

• Can you add a link to the image page on Wikipedia / Wikimedia Commons? Without a title or caption it's not clear what it's meant to depict. Aug 17, 2020 at 12:58
• @waldyrious sure Aug 17, 2020 at 12:59

Correct, the missing curvy section in the green-cyan-blue area represents where the red component would have to go negative to express those colors in CIE RGB coordinates.

RGB and XYZ are, at one level, just different coordinate systems covering the same color space—the space of all colors visible to typical human vision. In a mathematical sense, when used as coordinates, there's nothing wrong with negative RGB values (as long as the overall luminance of the color remains positive). But it does present a problem for storing or transmitting such values, as conventional image formats and display signal protocols like HDMI etc only allow for positive values.

On another level, various RGB color spaces are used because they more or less directly represent the actual red, green, and blue subpixels on the display. Those can't emit negative light of course, and so the RGB triangle in color space represents the gamut of colors that can be produced by the display.

Unfortunately because the spectral locus is curved, there's no way that 3 primaries can cover the whole thing. All RGB spaces inevitably cut off a big chunk of the highly saturated green/blue colors.

The XYZ space sort of has the opposite problem. All visible colors can be represented using only positive values in XYZ, but the XYZ primaries themselves are not physically possible colors—they're well outside the visible gamut. So, there's a big chunk of XYZ space that is not valid as a color. And it's not trivial to determine exactly what values are or aren't valid, as you have to test whether they fall inside or outside of the curved spectral locus. This also means that you need more bits per component to get good precision, if you store/transmit images expressed in XYZ—8 bits won't do, probably not 10 bits either, maybe 12 bits would do the job.

If we want to make displays that cover more of the visible gamut, we will eventually need to move to 4, 5, or more primaries. However, that doesn't mean we need 4- or 5-dimensional color spaces. A futuristic display device could be fed by images in XYZ space, for instance, and the device would decide how best to generate each color using the primaries it has available.

There is no such thing as negative light or light color. Having a model with negative values could give people funny ideas. So light behaves strictly like positive natural numbers.

Offcourse as far as coordinates go they can have negative values. But this would rise the question that your having: Howcome you can have values outside the span. Well, its not a gamut plot like you are used to seeing is just the coordinate system used. It does not tell anything of the device like a plot of say sRGB. So might be a bit misleading to draw it the same way.

Yes the values of a barycentric coordinate system outside a triangle neccessitates negative values.

The original CIE RGB colors included luminance within the actual encoding, and the original basis colors chosen for CIE RGB were chosen because they were easy to reproduce at that time. This made it much easier and more accurate when doing color experiments that required people to classify colors when producing those colors with real physical equipment.

But, because of these two choices, some of the colors required the red value (when plotted on a graph) to drop below zero. At the time having negative values was considered okay because the eye has a tough time in the 700nm range of colors so a little error here allowed for greater accuracy overall.

But, this caused a problem when translating CIE RGB colors into real physical colors. So they convened a panel, then they argued (a lot) and came up with the CIE XYZ color space. CIE XYZ attempts to separate lumanance (perceived brightness) out of the color gamut by encoding it in the Y channel, and it also removes those pesky negative values.

But, they needed to represent all the colors in the original CIE RGB color space in the new CIE XYZ color space. So, the CIE panel created color matching functions (or matrix depending on how you look at it) that exactly represents the CIE RGB color gamut in CIE XYZ color gamut. So, when you map both gamuts to a 2D plot they will actually plot to different points within the same graph because they are represented by different values.

Keep in mind that it is possible for two different wavelengths of light to be perceived as the same exact color so long as the weighted sum of the spectral distributions are equivalent. But that's a different story.