I'm calculating the Correlated Color Temperature (CCT) from a chromacity pair, and I am trying to find how far from the Planckian Locus the coordinates are.

What I'm currently doing is I read RGB values off a sensor, I do a matrix transformation to get to XYZ. Then I calculate the xy values, and lastly I use McCamy’s formula to get CCT.

McCamy’s formula gives me the Correlated Color Temperature, the nearest point along the Planckian Locus for the xy coordinates (roughly a orange to blue axis). I am trying to find the green/magenta content of the light, so I need to find how far from the locus the coordinates are (roughly a green to magenta axis).

I guess McCamy’s formula finds the normal down to the locus, and that I need to calculate how long that normal is. I also have to do it fast (this is running on a small embedded processor). I'm using the CIE 1931 color space. (EDIT: The illustration is from CIE 1960 as pointed out below, but I could not find a chart showing isothermal lines for CIE 1931)



I'm a bit confused because you write that you calculate the CCT using $xy$ values using McCamy's formula (I'm assuming you mean this formula), but you included a diagram of the Planckian locus in $uv$, not in $xy$. Presumably when you say you're trying to find how far from the Planckian locus the coordinates are, you're referring to the Euclidean distance either in $xy$ space or in $uv$ space? In either case, this section has approximations where you can plug in the CCT to get the corresponding coordinates on the Planckian locus; then you just have to calculate the Euclidean distance of your point from that point using Pythagoras. I guess since you're already approximating by using McCamy's formula, this further approximation will be OK; if not, you can always do a full summation over the standard observer as shown further up in the article.

  • 1
    $\begingroup$ Awesome! I guess the solution stared me in the face, right? Thanks for pointing it out. I already had the cubic spline function for calculating xy from Kelvin, so it is simply a matter of getting the "planckian" xy from this function and calculate the distance between the two coordinate pairs.//I used the illustration from uv space since I could not find one for xy space. I just learned that the isothermal lines are actually not normal to the locus for CIE 1931. I should probably switch to a newer color space some time in the future.//Again, thanks a lot! $\endgroup$ – morten Aug 22 '11 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.