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?
https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_RGB_color_space
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.