colour.temperature Package

Module Contents

colour.temperature.CCT_to_uv(CCT, D_uv=0, method=u'Ohno 2013', **kwargs)

Returns the CIE UCS colourspace uv chromaticity coordinates from given correlated colour temperature \(T_{cp}\) and \(\Delta_{uv}\) using given method.

Parameters:
  • CCT (numeric) – Correlated colour temperature \(T_{cp}\).
  • D_uv (numeric) – \(\Delta_{uv}\).
  • method (unicode, optional) – {‘Ohno 2013’, ‘Robertson 1968’}, Computation method.
  • **kwargs (**) – Keywords arguments.
Returns:

CIE UCS colourspace uv chromaticity coordinates.

Return type:

ndarray

Raises:

ValueError – If the computation method is not defined.

Examples

>>> from colour import STANDARD_OBSERVERS_CMFS
>>> cmfs = 'CIE 1931 2 Degree Standard Observer'
>>> cmfs = STANDARD_OBSERVERS_CMFS.get(cmfs)
>>> CCT = 6507.4342201047066
>>> D_uv = 0.003223690901512735
>>> CCT_to_uv(CCT, D_uv, cmfs=cmfs)  
array([ 0.1978003...,  0.3122005...])
colour.temperature.CCT_to_uv_Ohno2013(CCT, D_uv=0, cmfs=<colour.colorimetry.cmfs.XYZ_ColourMatchingFunctions object at 0x2abef8d86c10>)

Returns the CIE UCS colourspace uv chromaticity coordinates from given correlated colour temperature \(T_{cp}\), \(\Delta_{uv}\) and colour matching functions using Ohno (2013) method.

Parameters:
  • CCT (numeric) – Correlated colour temperature \(T_{cp}\).
  • D_uv (numeric, optional) – \(\Delta_{uv}\).
  • cmfs (XYZ_ColourMatchingFunctions, optional) – Standard observer colour matching functions.
Returns:

CIE UCS colourspace uv chromaticity coordinates.

Return type:

ndarray

References

[4]Ohno, Y. (2014). Practical Use and Calculation of CCT and Duv. LEUKOS, 10(1), 47–55. doi:10.1080/15502724.2014.839020

Examples

>>> from colour import STANDARD_OBSERVERS_CMFS
>>> cmfs = 'CIE 1931 2 Degree Standard Observer'
>>> cmfs = STANDARD_OBSERVERS_CMFS.get(cmfs)
>>> CCT = 6507.4342201047066
>>> D_uv = 0.003223690901512735
>>> CCT_to_uv_Ohno2013(CCT, D_uv, cmfs)  
array([ 0.1978003...,  0.3122005...])
colour.temperature.CCT_to_uv_Robertson1968(CCT, D_uv=0)

Returns the CIE UCS colourspace uv chromaticity coordinates from given correlated colour temperature \(T_{cp}\) and \(\Delta_{uv}\) using Roberston (1968) method.

Parameters:
  • CCT (numeric) – Correlated colour temperature \(T_{cp}\).
  • D_uv (numeric) – \(\Delta_{uv}\).
Returns:

CIE UCS colourspace uv chromaticity coordinates.

Return type:

ndarray

References

[7]Wyszecki, G., & Stiles, W. S. (2000). DISTRIBUTION TEMPERATURE, COLOR TEMPERATURE, AND CORRELATED COLOR TEMPERATURE. In Color Science: Concepts and Methods, Quantitative Data and Formulae (pp. 224–229). Wiley. ISBN:978-0471399186
[8]Adobe Systems. (2013). Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng_sdk_1_3/dng_sdk/source/dng_temperature.cpp:: dng_temperature::xy_coord. Retrieved from https://www.adobe.com/support/downloads/dng/dng_sdk.html

Examples

>>> CCT = 6500.0081378199056
>>> D_uv = 0.0083333312442250979
>>> CCT_to_uv_Robertson1968(CCT, D_uv)  
array([ 0.1937413...,  0.3152210...])
colour.temperature.uv_to_CCT(uv, method=u'Ohno 2013', **kwargs)

Returns the correlated colour temperature \(T_{cp}\) and \(\Delta_{uv}\) from given CIE UCS colourspace uv chromaticity coordinates using given method.

Parameters:
  • uv (array_like) – CIE UCS colourspace uv chromaticity coordinates.
  • method (unicode, optional) – {‘Ohno 2013’, ‘Robertson 1968’}, Computation method.
  • **kwargs (**) – Keywords arguments.
Returns:

Correlated colour temperature \(T_{cp}\), \(\Delta_{uv}\).

Return type:

ndarray

Raises:

ValueError – If the computation method is not defined.

Examples

>>> from colour import STANDARD_OBSERVERS_CMFS
>>> cmfs = 'CIE 1931 2 Degree Standard Observer'
>>> cmfs = STANDARD_OBSERVERS_CMFS.get(cmfs)
>>> uv = np.array([0.1978, 0.3122])
>>> uv_to_CCT(uv, cmfs=cmfs)  
array([  6.5075470...e+03,   3.2236908...e-03])
colour.temperature.uv_to_CCT_Ohno2013(uv, cmfs=<colour.colorimetry.cmfs.XYZ_ColourMatchingFunctions object at 0x2abef8d86c10>, start=1000, end=100000, count=10, iterations=6)

Returns the correlated colour temperature \(T_{cp}\) and \(\Delta_{uv}\) from given CIE UCS colourspace uv chromaticity coordinates, colour matching functions and temperature range using Ohno (2013) method.

The iterations parameter defines the calculations precision: The higher its value, the more planckian tables will be generated through cascade expansion in order to converge to the exact solution.

Parameters:
  • uv (array_like) – CIE UCS colourspace uv chromaticity coordinates.
  • cmfs (XYZ_ColourMatchingFunctions, optional) – Standard observer colour matching functions.
  • start (numeric, optional) – Temperature range start in kelvins.
  • end (numeric, optional) – Temperature range end in kelvins.
  • count (int, optional) – Temperatures count in the planckian tables.
  • iterations (int, optional) – Number of planckian tables to generate.
Returns:

Correlated colour temperature \(T_{cp}\), \(\Delta_{uv}\).

Return type:

ndarray

References

[3]Ohno, Y. (2014). Practical Use and Calculation of CCT and Duv. LEUKOS, 10(1), 47–55. doi:10.1080/15502724.2014.839020

Examples

>>> from colour import STANDARD_OBSERVERS_CMFS
>>> cmfs = 'CIE 1931 2 Degree Standard Observer'
>>> cmfs = STANDARD_OBSERVERS_CMFS.get(cmfs)
>>> uv = np.array([0.1978, 0.3122])
>>> uv_to_CCT_Ohno2013(uv, cmfs)  
array([  6.5075470...e+03,   3.2236908...e-03])
colour.temperature.uv_to_CCT_Robertson1968(uv)

Returns the correlated colour temperature \(T_{cp}\) and \(\Delta_{uv}\) from given CIE UCS colourspace uv chromaticity coordinates using Roberston (1968) method.

Parameters:uv (array_like) – CIE UCS colourspace uv chromaticity coordinates.
Returns:Correlated colour temperature \(T_{cp}\), \(\Delta_{uv}\).
Return type:ndarray

References

[5]Wyszecki, G., & Stiles, W. S. (2000). DISTRIBUTION TEMPERATURE, COLOR TEMPERATURE, AND CORRELATED COLOR TEMPERATURE. In Color Science: Concepts and Methods, Quantitative Data and Formulae (pp. 224–229). Wiley. ISBN:978-0471399186
[6]Adobe Systems. (2013). Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng_sdk_1_3/dng_sdk/source/dng_temperature.cpp:: dng_temperature::Set_xy_coord. Retrieved from https://www.adobe.com/support/downloads/dng/dng_sdk.html

Examples

>>> uv = np.array([0.19374137599822966, 0.31522104394059397])
>>> uv_to_CCT_Robertson1968(uv)  
array([  6.5000162...e+03,   8.3333289...e-03])
colour.temperature.CCT_to_xy(CCT, method=u'Kang 2002')

Returns the CIE XYZ tristimulus values xy chromaticity coordinates from given correlated colour temperature \(T_{cp}\) using given method.

Parameters:
  • CCT (numeric or array_like) – Correlated colour temperature \(T_{cp}\).
  • method (unicode, optional) – {‘Kang 2002’, ‘CIE Illuminant D Series’}, Computation method.
Returns:

xy chromaticity coordinates.

Return type:

ndarray

colour.temperature.CCT_to_xy_Kang2002(CCT)

Returns the CIE XYZ tristimulus values xy chromaticity coordinates from given correlated colour temperature \(T_{cp}\) using Kang et al. (2002) method.

Parameters:CCT (numeric or array_like) – Correlated colour temperature \(T_{cp}\).
Returns:xy chromaticity coordinates.
Return type:ndarray
Raises:ValueError – If the correlated colour temperature is not in appropriate domain.

References

[11]Kang, B., Moon, O., Hong, C., Lee, H., Cho, B., & Kim, Y. (2002). Design of advanced color: Temperature control system for HDTV applications. Journal of the Korean …, 41(6), 865–871. Retrieved from http://cat.inist.fr/?aModele=afficheN&cpsidt=14448733

Examples

>>> CCT_to_xy_Kang2002(6504.38938305)  
array([ 0.313426...,  0.3235959...])
colour.temperature.CCT_to_xy_CIE_D(CCT)

Converts from the correlated colour temperature \(T_{cp}\) of a CIE Illuminant D Series to the chromaticity of that CIE Illuminant D Series illuminant.

Parameters:CCT (numeric or array_like) – Correlated colour temperature \(T_{cp}\).
Returns:xy chromaticity coordinates.
Return type:ndarray
Raises:ValueError – If the correlated colour temperature is not in appropriate domain.

References

[12]Wyszecki, G., & Stiles, W. S. (2000). CIE Method of Calculating D-Illuminants. In Color Science: Concepts and Methods, Quantitative Data and Formulae (pp. 145–146). Wiley. ISBN:978-0471399186

Examples

>>> CCT_to_xy_CIE_D(6504.38938305)  
array([ 0.3127077...,  0.3291128...])
colour.temperature.xy_to_CCT(xy, method=u'McCamy 1992', **kwargs)

Returns the correlated colour temperature \(T_{cp}\) from given CIE XYZ tristimulus values xy chromaticity coordinates using given method.

Parameters:
  • xy (array_like) – xy chromaticity coordinates.
  • method (unicode, optional) – {‘McCamy 1992’, ‘Hernandez 1999’}, Computation method.
  • **kwargs (**) – Keywords arguments.
Returns:

Correlated colour temperature \(T_{cp}\).

Return type:

numeric or ndarray

colour.temperature.xy_to_CCT_McCamy1992(xy)

Returns the correlated colour temperature \(T_{cp}\) from given CIE XYZ tristimulus values xy chromaticity coordinates using McCamy (1992) method.

Parameters:xy (array_like) – xy chromaticity coordinates.
Returns:Correlated colour temperature \(T_{cp}\).
Return type:numeric or ndarray

References

[9]Wikipedia. (n.d.). Approximation. Retrieved June 28, 2014, from http://en.wikipedia.org/wiki/Color_temperature#Approximation

Examples

>>> xy = np.array([0.31271, 0.32902])
>>> xy_to_CCT_McCamy1992(xy)  
6504.3893830...
colour.temperature.xy_to_CCT_Hernandez1999(xy)

Returns the correlated colour temperature \(T_{cp}\) from given CIE XYZ tristimulus values xy chromaticity coordinates using Hernandez-Andres, Lee and Romero (1999) method.

Parameters:xy (array_like) – xy chromaticity coordinates.
Returns:Correlated colour temperature \(T_{cp}\).
Return type:numeric

References

[10]Hernández-Andrés, J., Lee, R. L., & Romero, J. (1999). Calculating correlated color temperatures across the entire gamut of daylight and skylight chromaticities. Applied Optics, 38(27), 5703–5709. doi:10.1364/AO.38.005703

Examples

>>> xy = np.array([0.31271, 0.32902])
>>> xy_to_CCT_Hernandez1999(xy)  
array(6500.0421533...)