colour.colorimetry.lightness Module

Lightness \(L*\)

Defines Lightness \(L*\) computation objects.

The following methods are available:

  • lightness_Glasser1958(): Lightness \(L^*\) computation of given luminance \(Y\) using Glasser, Mckinney, Reilly and Schnelle (1958)⁠⁠⁠ method.
  • lightness_Wyszecki1963(): Lightness \(W\) computation of given luminance \(Y\) using Wyszecki (1963)⁠⁠⁠⁠ method.
  • lightness_1976(): Lightness \(L^*\) computation of given luminance \(Y\) as per CIE Lab implementation.

References

[1]Wikipedia. (n.d.). Lightness. Retrieved April 13, 2014, from http://en.wikipedia.org/wiki/Lightness
colour.colorimetry.lightness.lightness_Glasser1958(Y, **kwargs)[source]

Returns the Lightness \(L\) of given luminance \(Y\) using Glasser, Mckinney, Reilly and Schnelle (1958) method.

Parameters:
  • Y (numeric or array_like) – luminance \(Y\).
  • **kwargs (**, optional) – Unused parameter provided for signature compatibility with other Lightness computation objects.
Returns:

Lightness \(L\).

Return type:

numeric or array_like

Notes

  • Input luminance \(Y\) is in domain [0, 100].
  • Output Lightness \(L\) is in domain [0, 100].

References

[2]Glasser, L. G., McKinney, A. H., Reilly, C. D., & Schnelle, P. D. (1958). Cube-Root Color Coordinate System. J. Opt. Soc. Am., 48(10), 736–740. doi:10.1364/JOSA.48.000736

Examples

>>> lightness_Glasser1958(10.08)  
36.2505626...
colour.colorimetry.lightness.lightness_Wyszecki1963(Y, **kwargs)[source]

Returns the Lightness \(W\) of given luminance \(Y\) using Wyszecki (1963) method.

Parameters:
  • Y (numeric or array_like) – luminance \(Y\).
  • **kwargs (**, optional) – Unused parameter provided for signature compatibility with other Lightness computation objects.
Returns:

Lightness \(W\).

Return type:

numeric or array_like

Notes

  • Input luminance \(Y\) is in domain [0, 100].
  • Output Lightness \(W\) is in domain [0, 100].

References

[3]Wyszecki, G. (1963). Proposal for a New Color-Difference Formula. J. Opt. Soc. Am., 53(11), 1318–1319. doi:10.1364/JOSA.53.001318

Examples

>>> lightness_Wyszecki1963(10.08)  
37.0041149...
colour.colorimetry.lightness.lightness_1976(Y, Y_n=100)[source]

Returns the Lightness \(L^*\) of given luminance \(Y\) using given reference white luminance \(Y_n\) as per CIE Lab implementation.

Parameters:
  • Y (numeric or array_like) – luminance \(Y\).
  • Y_n (numeric or array_like, optional) – White reference luminance \(Y_n\).
Returns:

Lightness \(L^*\).

Return type:

numeric or array_like

Notes

  • Input luminance \(Y\) and \(Y_n\) are in domain [0, 100].
  • Output Lightness \(L^*\) is in domain [0, 100].

References

[4]Wyszecki, G., & Stiles, W. S. (2000). CIE 1976 (L*u*v*)-Space and Color-Difference Formula. In Color Science: Concepts and Methods, Quantitative Data and Formulae (p. 167). Wiley. ISBN:978-0471399186
[5]Lindbloom, B. (2003). A Continuity Study of the CIE L* Function. Retrieved February 24, 2014, from http://brucelindbloom.com/LContinuity.html

Examples

>>> lightness_1976(10.08)  
array(37.9856290...)
colour.colorimetry.lightness.LIGHTNESS_METHODS = CaseInsensitiveMapping({u'Lstar1976': <function lightness_1976 at 0x2abef8de8050>, u'Wyszecki 1963': <function lightness_Wyszecki1963 at 0x2abef8d83f50>, u'CIE 1976': <function lightness_1976 at 0x2abef8de8050>, u'Glasser 1958': <function lightness_Glasser1958 at 0x2abef8d83ed8>})

Supported Lightness computations methods.

LIGHTNESS_METHODS : CaseInsensitiveMapping
{‘Glasser 1958’, ‘Wyszecki 1963’, ‘CIE 1976’}

Aliases:

  • ‘Lstar1976’: ‘CIE 1976’
colour.colorimetry.lightness.lightness(Y, method=u'CIE 1976', **kwargs)[source]

Returns the Lightness \(L^*\) using given method.

Parameters:
  • Y (numeric or array_like) – luminance \(Y\).
  • method (unicode, optional) – {‘CIE 1976’, ‘Glasser 1958’, ‘Wyszecki 1963’}, Computation method.
  • **kwargs (**) – Keywords arguments.
Returns:

Lightness \(L^*\).

Return type:

numeric or array_like

Notes

  • Input luminance \(Y\) and optional \(Y_n\) are in domain [0, 100].
  • Output Lightness \(L^*\) is in domain [0, 100].

Examples

>>> lightness(10.08)  
array(37.9856290...)
>>> lightness(10.08, Y_n=100)  
array(37.9856290...)
>>> lightness(10.08, Y_n=95)  
array(38.9165987...)
>>> lightness(10.08, method='Glasser 1958')  
36.2505626...
>>> lightness(10.08, method='Wyszecki 1963')  
37.0041149...