From f3c42c33c492d9cdf492959bbe71602e8c5a73ee Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Wed, 3 Sep 2014 14:44:39 +0200 Subject: [PATCH] Update "colour.colorimetry.lightness" module references. --- colour/colorimetry/lightness.py | 47 +++++++++++++++++++++------------ colour/constants/cie.py | 12 ++++----- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/colour/colorimetry/lightness.py b/colour/colorimetry/lightness.py index 0824b4adea..0c4751d9b5 100644 --- a/colour/colorimetry/lightness.py +++ b/colour/colorimetry/lightness.py @@ -11,7 +11,7 @@ - :func:`lightness_glasser1958`: *Lightness* :math:`L^*` computation of given *luminance* :math:`Y` using *Glasser et al. (1958)* method. -- :func:`lightness_wyszecki1964`: *Lightness* :math:`W^*` computation of +- :func:`lightness_wyszecki1964`: *Lightness* :math:`W` computation of given *luminance* :math:`Y` using *Wyszecki (1964)* method. - :func:`lightness_1976`: *Lightness* :math:`L^*` computation of given *luminance* :math:`Y` as per *CIE Lab* implementation. @@ -20,6 +20,11 @@ -------- `Lightness IPython Notebook `_ # noqa + +References +---------- +.. [1] http://en.wikipedia.org/wiki/Lightness + (Last accessed 13 April 2014) """ from __future__ import division, unicode_literals @@ -43,7 +48,7 @@ def lightness_glasser1958(Y, **kwargs): """ - Returns the *Lightness* :math:`L^*` of given *luminance* :math:`Y` using + Returns the *Lightness* :math:`L` of given *luminance* :math:`Y` using *Glasser et al. (1958)* method. Parameters @@ -57,17 +62,18 @@ def lightness_glasser1958(Y, **kwargs): Returns ------- numeric - *Lightness* :math:`L^*`. + *Lightness* :math:`L`. Notes ----- - Input *luminance* :math:`Y` is in domain [0, 100]. - - Output *Lightness* :math:`L^*` is in domain [0, 100]. + - Output *Lightness* :math:`L` is in domain [0, 100]. References ---------- - .. [1] http://en.wikipedia.org/wiki/Lightness - (Last accessed 13 April 2014) + .. [2] **Glasser et al.**, *Cube-Root Color Coordinate System*, + *JOSA, Vol. 48, Issue 10, pp. 736-740 (1958)*, + DOI: http://dx.doi.org/10.1364/JOSA.48.000736 Examples -------- @@ -75,14 +81,14 @@ def lightness_glasser1958(Y, **kwargs): 36.2505626... """ - L_star = 25.29 * (Y ** (1 / 3)) - 18.38 + L = 25.29 * (Y ** (1 / 3)) - 18.38 - return L_star + return L def lightness_wyszecki1964(Y, **kwargs): """ - Returns the *Lightness* :math:`W^*` of given *luminance* :math:`Y` using + Returns the *Lightness* :math:`W` of given *luminance* :math:`Y` using *Wyszecki (1964)* method. @@ -97,17 +103,18 @@ def lightness_wyszecki1964(Y, **kwargs): Returns ------- numeric - *Lightness* :math:`W^*`. + *Lightness* :math:`W`. Notes ----- - Input *luminance* :math:`Y` is in domain [0, 100]. - - Output *Lightness* :math:`W^*` is in domain [0, 100]. + - Output *Lightness* :math:`W` is in domain [0, 100]. References ---------- - .. [2] http://en.wikipedia.org/wiki/Lightness - (Last accessed 13 April 2014) + .. [3] **G. Wyszecki**, *Proposal for a New Color-Difference Formula*, + *JOSA, Vol. 53, Issue 11, pp. 1318-1319 (1963)*, + DOI: http://dx.doi.org/10.1364/JOSA.53.001318 Examples -------- @@ -149,8 +156,14 @@ def lightness_1976(Y, Y_n=100): References ---------- - .. [3] http://www.poynton.com/PDFs/GammaFAQ.pdf - (Last accessed 12 April 2014) + .. [4] **Wyszecki & Stiles**, + *Color Science - Concepts and Methods Data and Formulae - + Second Edition*, + Wiley Classics Library Edition, published 2000, + ISBN-10: 0-471-39918-3, + page 167. + .. [5] http://brucelindbloom.com/index.html?LContinuity.html + (Last accessed 24 February 2014) Examples -------- @@ -210,9 +223,9 @@ def lightness(Y, method='CIE 1976', **kwargs): -------- >>> lightness(10.08) # doctest: +ELLIPSIS 37.9856290... - >>> lightness(10.08, Yn=100) # doctest: +ELLIPSIS + >>> lightness(10.08, Y_n=100) # doctest: +ELLIPSIS 37.9856290... - >>> lightness(10.08, Yn=95) # doctest: +ELLIPSIS + >>> lightness(10.08, Y_n=95) # doctest: +ELLIPSIS 38.9165987... >>> lightness(10.08, method='Glasser 1958') # doctest: +ELLIPSIS 36.2505626... diff --git a/colour/constants/cie.py b/colour/constants/cie.py index 8bed3fe1ef..065f232603 100644 --- a/colour/constants/cie.py +++ b/colour/constants/cie.py @@ -30,11 +30,11 @@ ----- - The original *CIE* value for :math:`\epsilon` is :math:`\epsilon=0.008856`, **Bruce Lindbloom** has shown that this value is causing a discontinuity - a the junction point of the two functions grafted together to create the + at the junction point of the two functions grafted together to create the *Lightness* :math:`L^*` function. That discontinuity can be avoided by using the rational representation as - follows: :math:`\epsilon=216/24389`. + follows: :math:`\epsilon=216\ /\ 24389`. References ---------- @@ -45,19 +45,19 @@ CIE_K = 24389 / 27 """ -*CIE* :math:`k` constant. +*CIE* :math:`\kappa` constant. CIE_K : numeric Notes ----- -- The original *CIE* value for :math:`k` is :math:`k=903.3`, +- The original *CIE* value for :math:`\kappa` is :math:`\kappa=903.3`, **Bruce Lindbloom** has shown that this value is causing a discontinuity - a the junction point of the two functions grafted together to create the + at the junction point of the two functions grafted together to create the *Lightness* :math:`L^*` function. That discontinuity can be avoided by using the rational representation as - follows: :math:`k=24389/27`. + follows: :math:`k=24389\ /\ 27`. References ----------