[New feature] CCT - Correlated Color Temperature #135
Replies: 7 comments
|
Thanks for opening this issue, CCT is one of the features I've been considering. In general, I would prefer a concise solution, where available, that doesn't rely on large lookup tables. I'll have to research the topic a bit. |
|
With the help of below 2 functions I'm able to calculate the CCT in very flexible way: For CCT calculation: For transformation into CIE-xyY coordinates: |
|
This should also be an interesting read on the topic: https://www.osapublishing.org/oe/fulltext.cfm?uri=oe-24-13-14066&id=344803 |
|
It's up to you to choose from available solutions. McCamy cubic approximation is very easy to implement - but for sure not the best solution in terms of accuracy |
Bruce Justin Lindbloom has created Javascript code based on Robertson method: The deviation of the Robertson method (+/-12) compared with McCamy (+/- 284) is much more better. Actually the most accurate solution seems to be the Y. Ohno's CCT (combined solution) calculation methods (+/-1) Phython script available on Colour's Git: |
|
The Ohno function requires at least a little bit of a lookup table because it requires working from Planck spectrum -- you'd at least need XYZ data points. Robertson sounds more reasonable for the goal of not needing any tables. It's got some good simplicity and very nice use of the considerably more uniform mirad scale. There's even an improved Robertson fit from 2022, going down to +/- 0.1 K from 1,500 K to 40,000 K; the number of data points is expanded from 31 to 372. doug-baxter-modifications-of-the-robertson-method-for.pdf At 188 points it's already better than Ohno, with max error of 0.4 K. The above is for doing the xyY -> CCT calculation. For the inverse, which is what you need for guessing what a CCT looks like, you have two choices:
|
|
Is there anything an uneducated layman, such as myself, do to help implement this feature into the library? |
Uh oh!
There was an error while loading. Please reload this page.
Correlated Color Temperature (CCT) (in K)
Returns a correlated color temperature.
Option A:
Based on Bruce Justin Lindbloom's implementation
http://www.brucelindbloom.com/Eqn_XYZ_to_T.html
Option B:
based on McCamy cubic approximation
https://en.wikipedia.org/wiki/Color_temperature
Benefit of option B:
Caculation of xyY coordinates which are actually not covered by culori
All reactions