top | item 41083558

(no title)

jlongster | 1 year ago

Author of the article here; I wasn't able to understand how to get that to work, and I talked about that in the post. This demo is doing that: https://jlongster.com/why-chromaticity-shape#block-31f373

The problem is "for each pixel inside the area". I could have done that, and then clipped the output by that shape. The problem is this doesn't answer why the shape is this way at all because you are using the shape itself to clip the output. It felt fake.

I do think this is what is most common though. I was trying to understand a more rigorous approach, and the one where you generate spectra and try to fill it is described here: https://clarkvision.com/articles/color-cie-chromaticity-and-...

That feels like a more rigorous approach, but clipping is probably "good enough" too

discuss

order

meindnoch|1 year ago

Ok, so you're asking why every visible color has to lie within the bounds of the spectral locus in the chromaticity diagram?

The reasoning is simple:

1. Spectral colors are basis vectors of the color spectrum. I.e. every possible spectrum can be thought of as a weighted sum of infinitely many Dirac deltas. With nonnegative weights, in particular, so it's a so-called conical combination (i.e. linear combination with nonnegative weights).

2. Taking the inner product with color matching functions is a linear transformation from this infinite dimensional space spanned by spectral colors to a 3-dimensional space. Linearity means that weighted sums are preserved, that is: every possible color spectrum's XYZ values are going to be the weighted sum of the spectral colors' XYZ values. And because the XYZ color matching functions are nonnegative everywhere, conical combinations are also preserved.

3. And finally, the conversion from XYZ to xyz is such, that it turns conical combinations into convex combinations (i.e. conical combinations where the weights sum to 1). It's easy to verify this with pen and paper.

It follows, that every color on the xy chart is going to be a convex combination of xy points corresponding to spectral colors, which geometrically means that they're going to lie inside the spectral colors' convex hull.