When we look at the 1931 CIE chromaticity diagram, represented within the x y plane of xyY space, it renders white colors (or close to white) at points of luminance like the D65 point highlighted here with E.
But why is this the case? The point for D65 is supposed to be represented at x = 0.33, y = 0.33
. Given the formula Y = 1 - x - y
, wouldn't that mean Y is 0.34?
The sRGB correlate or xyY at 0.33,0.33,0.34
is 158.4182, 155.5676, 176.8565
according to every converter I found. This is a light brown and not the near-white seen in every 1931 chromaticity diagram.
It seems like I need to scale the Y to get the proper luminance value for every channel.
Using the Y = 1 - x - y
formula, my diagram looks like this, a muted diagram:
What don't I understand?
Edit
Setting Y = 1 and the diagram looks like the below, better.
Edit
Now looks like the below.
There is some imprecision on the interpretation of chromacity diagrams.
CIE xyY is a 3D figures. Often we see only a projections (often not a intersecting plane, just a projection).
One common projection is the "additive" xy chromacity diagram. You may notice it because it has yellow at border, and the white somewhere near the center. In such projection you show the maximum Y given a chromacity x,y.
Common is also the "subtractive" diagram, like your second one. No yellow, no white. This diagram has just the subtractive mix of the primaries, so the brighter colour are the primaries, and you get darken between them.
Note: usually the chromacity diagram are also extended also out of gamut, so the primaries are no more the real primaries, and white could not be white, and the yellow could be cut off, as your diagrams. You may try at first just the triangle between primaries, then expand. It is easier to debug.
The white will be just on top of 3D figure. In the first case, you take the outer surface of gamut, so you get the white. In the second case, you get a plane inside the figure, so you will never get white. But it is still a xy chromacity diagram.
On your case, I think you clipped the colour values (Note 1), which it is wrong: by clipping you will not get the correct chromacities (by clipping, one remove a certain value of a colour, so the ratio between channel is not maintained). One should use float or larger numbers for calculations, before to normalize (channel values in range 0 to 255). [Normalize (in this case): keep chromacity, but adapt Y so that final colour is in gamut]. In practice: you get the maximum value between
R
,G
,B
, and you multiply every channels by255/max(R,G,B)
.Note: this is not fully correct/precise. The above normalization should be done in linear space (light mix linearly), and only after normalization, the gamma funtion should be applied. On the other hand, on above figures, we do not have the correct colour for every point x,y. We can do it correctly only on a triangle (of gamut). By expanding the available colour on screen to full xz chromacity, we create errors/imprecisions. So normalization before or after gamma correction is not more so relevant (and it just change slightly the colours).
Note 1: From comment: this (clipping) it is not true, OTOH the very tiny part of blue (dark blue), and too much magenta and cyan, make me thinking about some numerical prolem)