Why "colour.xy_to_CCT(xy, 'McCamy 1992')" definition return value doesn't match the formula? #821
-
Hi there, thanks for this wonderful package! I have a question regarding the
However according to McCamy's equations:
The CCT for [231.0, 260.0, 95.0] should be 3121K, as described in this paper (https://ams.com/documents/20143/80162/TCS34xx_AN000517_1-00.pdf/1efe49f7-4f92-ba88-ca7c-5121691daff7). I'm wondering if there's something wrong with my understanding. The version of my colour-science is 0.3.16. Thanks for your attention! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @lishichengyan, So your code is not quite correct for two reasons:
Keeping all that in mind: import colour
import numpy as np
RGB = np.array([231.0, 260.0, 95.0])
M = [
[-0.14282, +1.54924, -0.95641],
[-0.32466, +1.57837, -0.73191],
[-0.68202, +0.77073, +0.56332 ],
]
XYZ = colour.algebra.vector_dot(M, RGB)
xy = colour.XYZ_to_xy(XYZ)
colour.xy_to_CCT(xy, 'McCamy 1992')
3121.062453413394 |
Beta Was this translation helpful? Give feedback.
Hi @lishichengyan,
So your code is not quite correct for two reasons:
colour.sRGB_to_XYZ
convenience definition assumes that data is encoded non-linearly and thus will decode it. You should passapply_cctf_decoding=False
.Keeping all that in mind: