Convert CCT (Correlated Color Temperature) to x, y Chromaticities

2.3k views Asked by At

I'm trying to convert a CCT of 6504K into x, y chromaticities in 1931 2deg color space. Followed the equation on this Wikipedia page under section COMPUTATION - doing this in Python 3.6.

D65 (of 6504K) is specified as 0.31271, 0.32902 (see same Wikipedia page further down)

The resulting x, y coordinates that I get are: [0.31271405688264753, 0.3291190991371872]

As you can see my x value is spot on, but the y value is off - and in the equation it is calculating y from x. I've checked this now 20 times and cannot find an error...

Any idea why the y coordinate is incorrect ?

Thanks.

1

There are 1 answers

1
Kel Solaar On BEST ANSWER

Your value is correct for 6504k, here it is computed with Colour:

>>> import colour
>>> colour.temperature.CCT_to_xy_CIE_D(6504)
array([ 0.31271406,  0.3291191 ])

Note that technically for D65, you should compute it as follows:

>>> import colour
>>> colour.temperature.CCT_to_xy_CIE_D(6500 * 1.4388 / 1.4380)
array([ 0.31272027,  0.32912528])

This is to account properly for the modification of the C_2 radiation constant in the Planck's Law in 1968 which results in the colour temperature being equal to 6503.616133518777. From here you should start to see that there might be rounding issues involved with the discrepancies.

Now, taking the CIE XYZ tristimulus values from D65 as given by the CIE in CIE 015:2018 Colorimetry, 4th Edition. https://doi.org/10.25039/TR.015.2018:

>>> import colour
>>> colour.XYZ_to_xy([95.04, 100, 108.88])
array([ 0.31271387,  0.32903396])

The value they give in the standard for the D65 chromaticity coordinates is: [0.31272, 0.32903].

Unfortunately, there is no single right answer, however, one commonly used and somehow agreed on is [0.3127, 0.3290] and is used by most RGB colourspaces using D65.