LMS color space

From HandWiki
Short description: Color space represented by the response of the three types of cones of the human eye
Normalized responsivity spectra of human cone cells, S, M, and L types (SMJ data based on Stiles and Burch[1] RGB color-matching, linear scale, weighted for equal energy)[2]

LMS (long, medium, short), is a color space which represents the response of the three types of cones of the human eye, named for their responsivity (sensitivity) peaks at long, medium, and short wavelengths.

The numerical range is generally not specified, except that the lower end is generally bounded by zero. It is common to use the LMS color space when performing chromatic adaptation (estimating the appearance of a sample under a different illuminant). It's also useful in the study of color blindness, when one or more cone types are defective.

Definition

The cone response functions [math]\displaystyle{ \bar{l}(\lambda), \bar{m}(\lambda),\bar{s}(\lambda) }[/math] are the color matching functions for the LMS color space. The chromaticity coordinates (L, M, S) for a spectral distribution [math]\displaystyle{ J(\lambda) }[/math] are defined as:

[math]\displaystyle{ L = \int^\infty_0 J(\lambda)\bar{l}(\lambda)d\lambda }[/math]
[math]\displaystyle{ M = \int^\infty_0 J(\lambda)\bar{m}(\lambda)d\lambda }[/math]
[math]\displaystyle{ S = \int^\infty_0 J(\lambda)\bar{s}(\lambda)d\lambda }[/math]

The cone response functions are normalized to have their maxima equal to unity.

XYZ to LMS

Typically, colors to be adapted chromatically will be specified in a color space other than LMS (e.g. sRGB). The chromatic adaptation matrix in the diagonal von Kries transform method, however, operates on tristimulus values in the LMS color space. Since colors in most colorspaces can be transformed to the XYZ color space, only one additional transformation matrix is required for any color space to be adapted chromatically: to transform colors from the XYZ color space to the LMS color space.[3]

In addition, many color adaption methods, or color appearance models (CAMs), run a von Kries-style diagonal matrix transform in a slightly modified, LMS-like, space instead. They may refer to it simply as LMS, as RGB, or as ργβ. The following text uses the "RGB" naming, but do note that the resulting space has nothing to do with the additive color model called RGB.[3]

The chromatic adaptation transform (CAT) matrices for some CAMs in terms of CIEXYZ coordinates are presented here. The matrices, in conjunction with the XYZ data defined for the standard observer, implicitly define a "cone" response for each cell type.

Notes:

Hunt, RLAB

The Hunt and RLAB color appearance models use the Hunt-Pointer-Estevez transformation matrix (MHPE) for conversion from CIE XYZ to LMS.[4][5][6] This is the transformation matrix which was originally used in conjunction with the von Kries transform method, and is therefore also called von Kries transformation matrix (MvonKries).

  • Equal-energy illuminants: [math]\displaystyle{ \begin{bmatrix} L\\M\\S \end{bmatrix}_\text{E} = \left[\begin{array}{lll} \phantom{-}0.38971 & \phantom{-}0.68898 & -0.07868\\ -0.22981 & \phantom{-}1.18340 & \phantom{-}0.04641\\ \phantom{-}0 & \phantom{-}0 & \phantom{-}1 \end{array}\right] \begin{bmatrix} X\\Y\\Z \end{bmatrix} }[/math]
  • Normalized[7] to D65: [math]\displaystyle{ \begin{bmatrix} L\\M\\S \end{bmatrix}_{\text{D65}} = \left[\begin{array}{lll} \phantom{-}0.4002 & \phantom{-}0.7076 & -0.0808 \\ -0.2263 & \phantom{-}1.1653 & \phantom{-}0.0457 \\ \phantom{-}0 & \phantom{-}0 & \phantom{-}0.9182 \end{array}\right] \begin{bmatrix} X\\Y\\Z \end{bmatrix} }[/math]

Bradford's spectrally sharpened matrix (LLAB, CIECAM97s)

The original CIECAM97s color appearance model uses the Bradford transformation matrix (MBFD) (as does the LLAB color appearance model).[3] This is a “spectrally sharpened” transformation matrix (i.e. the L and M cone response curves are narrower and more distinct from each other). The Bradford transformation matrix was supposed to work in conjunction with a modified von Kries transform method which introduced a small non-linearity in the S (blue) channel. However, outside of CIECAM97s and LLAB this is often neglected and the Bradford transformation matrix is used in conjunction with the linear von Kries transform method, explicitly so in ICC profiles.[8]

[math]\displaystyle{ \begin{bmatrix} R \\ G \\ B \end{bmatrix}_\text{BFD} = \left[\begin{array}{lll} \phantom{-}0.8951 & \phantom{-}0.2664 & -0.1614 \\ -0.7502 & \phantom{-}1.7135 & \phantom{-}0.0367 \\ \phantom{-}0.0389 & -0.0685 & \phantom{-}1.0296 \end{array}\right] \begin{bmatrix} X \\ Y \\ Z \end{bmatrix} }[/math]

A "spectrally sharpened" matrix is believed to improve chromatic adaptation especially for blue colors, but does not work as a real cone-describing LMS space for later human vision processing. Although the outputs are called "LMS" in the original LLAB incarnation, CIECAM97s uses a different "RGB" name to highlight that this space does not really reflect cone cells; hence the different names here.

LLAB proceeds by taking the post-adaptation XYZ values and performing a CIELAB-like treatment to get the visual correlates. On the other hand, CIECAM97s takes the post-adaptation XYZ value back into the Hunt LMS space, and works from there to model the vision system's calculation of color properties.

Later CIECAMs

A revised version of CIECAM97s switches back to a linear transform method and introduces a corresponding transformation matrix (MCAT97s):[9]

[math]\displaystyle{ \begin{bmatrix} R\\G\\B \end{bmatrix}_\text{97} = \left[\begin{array}{lll} \phantom{-}0.8562 & \phantom{-}0.3372 & -0.1934 \\ -0.8360 & \phantom{-}1.8327 & \phantom{-}0.0033 \\ \phantom{-}0.0357 & -0.0469 & \phantom{-}1.0112 \end{array}\right] \begin{bmatrix} X\\Y\\Z \end{bmatrix} }[/math]

The sharpened transformation matrix in CIECAM02 (MCAT02) is:[10][3]

[math]\displaystyle{ \begin{bmatrix} R\\G\\B \end{bmatrix}_\text{02} = \left[\begin{array}{lll} \phantom{-}0.7328 & \phantom{-}0.4296 & -0.1624\\ -0.7036 & \phantom{-}1.6975 & \phantom{-}0.0061\\ \phantom{-}0.0030 & \phantom{-}0.0136 & \phantom{-}0.9834 \end{array}\right] \begin{bmatrix} X\\Y\\Z \end{bmatrix} }[/math]

CAM16 uses a different matrix:[11] [math]\displaystyle{ \begin{bmatrix} R\\G\\B \end{bmatrix}_\text{16} = \left[\begin{array}{lll} \phantom{-}0.401288 & \phantom{-}0.650173 & -0.051461 \\ -0.250268 & \phantom{-}1.204414 & \phantom{-}0.045854 \\ -0.002079 & \phantom{-}0.048952 & \phantom{-}0.953127 \end{array}\right] \begin{bmatrix} X\\Y\\Z \end{bmatrix} }[/math]

As in CIECAM97s, after adaptation, the colors are converted to the traditional Hunt–Pointer–Estévez LMS for final prediction of visual results.

physiological CMFs

From a physiological point of view, the LMS color space describes a more fundamental level of human visual response, so it makes more sense to define the physiopsychological XYZ by LMS, rather than the other way around.

A set of physiologically-based LMS functions were proposed by Stockman & Sharpe in 2000. The functions have been published in a technical report by the CIE in 2006 (CIE 170).[12][13] The functions are derived from Stiles and Burch[1] RGB CMF data, combined with newer measurements about the contribution of each cone in the RGB functions. To adjust from the 10° data to 2°, assumptions about photopigment density difference and data about the absorption of light by pigment in the lens and the macula lutea are used.[14]

XYZ color matching functions, CIE 1931 and Stockman & Sharpe 2006.

The Stockman & Sharpe functions can then be turned into a set of three color-matching functions similar to the CIE 1931 functions.[15]

Let [math]\displaystyle{ \mathcal{P}_i(\lambda)=(\bar{l}(\lambda), \bar{m}(\lambda),\bar{s}(\lambda)) }[/math] be the three cone response functions, and let [math]\displaystyle{ \mathcal{Q}_i(\lambda)=(\bar{x}_F(\lambda), \bar{y}_F(\lambda),\bar{z}_F(\lambda)) }[/math] be the new XYZ color matching functions. Then, by definition, the new XYZ color matching functions are:

[math]\displaystyle{ \mathcal{Q}_i(\lambda)=\sum_{j=1}^3 T_{ij}\mathcal{P}_j(\lambda) }[/math]

where the transformation matrix [math]\displaystyle{ T_{ij} }[/math] is defined as:

[math]\displaystyle{ T_{ij}= \left[\,\begin{array}{lll} 1.94735469 & -1.41445123 & \phantom{-}0.36476327 \\ 0.68990272 & \phantom{-}0.34832189 & \phantom{-}0 \\ 0 & \phantom{-}0 & \phantom{-}1.93485343 \end{array}\right] }[/math]

The derivation of this transformation is relatively straightforward.[16] The [math]\displaystyle{ \bar{y}_F(\lambda) }[/math] CMF is the luminous efficiency function originally proposed by Sharpe et al. (2005)[17], but then corrected (Sharpe et al., 2011[18][lower-alpha 1]). The [math]\displaystyle{ \bar{z}_F(\lambda) }[/math] CMF is equal to the [math]\displaystyle{ \bar{s}(\lambda) }[/math] cone fundamental originally proposed by Stockman, Sharpe & Fach (1999)[19] scaled to have an integral equal to the [math]\displaystyle{ \bar{y}_F(\lambda) }[/math] CMF. The definition of the [math]\displaystyle{ \bar{x}_F(\lambda) }[/math] CMF is derived from the following constraints:
  1. Like the other CMFs, the values of [math]\displaystyle{ \bar{x}_F(\lambda) }[/math] are all positive.
  2. The integral of [math]\displaystyle{ \bar{x}_F(\lambda) }[/math] is identical to the integrals for [math]\displaystyle{ \bar{y}_F(\lambda) }[/math] and [math]\displaystyle{ \bar{z}_F(\lambda) }[/math].
  3. The coefficients of the transformation that yields [math]\displaystyle{ \bar{x}_F(\lambda) }[/math] are optimized to minimize the Euclidean differences between the resulting [math]\displaystyle{ \bar{x}_F(\lambda) }[/math], [math]\displaystyle{ \bar{y}_F(\lambda) }[/math] and [math]\displaystyle{ \bar{z}_F(\lambda) }[/math] color matching functions and the CIE 1931 [math]\displaystyle{ \bar{x}(\lambda) }[/math], [math]\displaystyle{ \bar{y}(\lambda) }[/math] and [math]\displaystyle{ \bar{z}(\lambda) }[/math] color matching functions.
— CVRL description for 'CIE (2012) 2-deg XYZ “physiologically-relevant” colour matching functions'[15]

For any spectral distribution [math]\displaystyle{ J(\lambda) }[/math], let [math]\displaystyle{ P_i=(L,M,S) }[/math] be the LMS chromaticity coordinates for [math]\displaystyle{ J(\lambda) }[/math], and let [math]\displaystyle{ Q_i=(X,Y,Z)_F }[/math] be the corresponding new XYZ chromaticity coordinates. Then:

[math]\displaystyle{ Q_i = \int^\infty_0 J(\lambda)\mathcal{Q}_i(\lambda)d\lambda = \int^\infty_0 J(\lambda) \sum_{j=1}^3 T_{ij} \mathcal{P}_j(\lambda)d\lambda = \sum_{j=1}^3 T_{ij}P_j }[/math]

or, explicitly:

[math]\displaystyle{ \begin{bmatrix} X \\ Y \\ Z \end{bmatrix}_{\text{F}} = \left[\,\begin{array}{lll} 1.94735469 & -1.41445123 & \phantom{-}0.36476327 \\ 0.68990272 & \phantom{-}0.34832189 & \phantom{-}0 \\ 0 & \phantom{-}0 & \phantom{-}1.93485343 \end{array}\right] \begin{bmatrix} L\\M\\S \end{bmatrix} }[/math]

The inverse matrix is shown here for comparison with the ones for traditional XYZ:

[math]\displaystyle{ \begin{bmatrix} L\\M\\S \end{bmatrix} = \left[\begin{array}{lll} \phantom{-}0.210576 & \phantom{-}0.855098 & -0.0396983 \\ -0.417076 & \phantom{-}1.177260 & \phantom{-}0.0786283 \\ \phantom{-}0 & \phantom{-}0 & \phantom{-}0.5168350 \\ \end{array}\right] \begin{bmatrix} X\\Y\\Z \end{bmatrix}_{\text{F}} }[/math]

The above development has the advantage of basing the new XFYFZF color matching functions on the physiologically-based LMS cone response functions. In addition, it offers a one-to-one relationship between the LMS chromaticity coordinates and the new XFYFZF chromaticity coordinates, which was not the case for the CIE 1931 color matching functions. The transformation for a particular color between LMS and the CIE 1931 XYZ space is not unique. It rather depends highly on the particular form of the spectral distribution [math]\displaystyle{ J(\lambda) }[/math] ) producing the given color. There is no fixed 3x3 matrix which will transform between the CIE 1931 XYZ coordinates and the LMS coordinates, even for a particular color, much less the entire gamut of colors. Any such transformation will be an approximation at best, generally requiring certain assumptions about the spectral distributions producing the color. For example, if the spectral distributions are constrained to be the result of mixing three monochromatic sources, (as was done in the measurement of the CIE 1931 and the Stiles and Burch[1] color matching functions), then there will be a one-to-one relationship between the LMS and CIE 1931 XYZ coordinates of a particular color.

As of Nov 28, 2023, CIE 170-2 CMFs are proposals that have yet to be ratified by the full TC 1-36 committee or by the CIE.

Applications

Color blindness

The LMS color space can be used to emulate the way color-blind people see color. An early emulation of dichromats were produced by Brettel et al. 1997 and was rated favorably by actual patients. An example of a state-of-the-art method is Machado et al. 2009.[20]

A related application is making color filters for color-blind people to more easily notice differences in color, a process known as daltonization.[21]

Image processing

JPEG XL uses an XYB color space derived from LMS. Its transform matrix is shown here:

[math]\displaystyle{ \begin{bmatrix} X\\Y\\B \end{bmatrix} = \begin{bmatrix} 1 & -1 & \phantom{-}0 \\ 1 & \phantom{-}1 & \phantom{-}0 \\ 0 & \phantom{-}0 & \phantom{-}1 \end{bmatrix} \begin{bmatrix} L\\M\\S \end{bmatrix} }[/math]

This can be interpreted as a hybrid color theory where L and M are opponents but S is handled in a trichromatic way, justified by the lower spatial density of S cones. In practical terms, this allows for using less data for storing blue signals without losing much perceived quality.[22]

The colorspace originates from Guetzli's butteraugli metric,[23] and was passed down to JPEG XL via Google's Pik project.

See also

References

  1. 2011 correction is taken into account with the CIE (2012) matrix.
  1. 1.0 1.1 1.2 Stiles, WS; Burch, JM (1959). "NPL colour-matching investigation: final report". Optica Acta 6. 
  2. "Stockman, MacLeod & Johnson 2-deg cone fundamentals (description page)". http://www.cvrl.org/database/text/cones/smj2.htm.  data retrieval page
  3. 3.0 3.1 3.2 3.3 3.4 3.5 Fairchild, Mark D. (2005). Color Appearance Models (2E ed.). Wiley Interscience. pp. 182–183, 227–230. ISBN 978-0-470-01216-1. https://books.google.com/books?id=8_TxzK2B-5MC&q=hunt+model+tristimulus+matrix&pg=PA228. 
  4. Schanda, Jnos, ed (2007-07-27) (in en). Colorimetry. pp. 305. doi:10.1002/9780470175637. ISBN 9780470175637. 
  5. Moroney, Nathan; Fairchild, Mark D.; Hunt, Robert W.G.; Li, Changjun; Luo, M. Ronnier; Newman, Todd (November 12, 2002). "The CIECAM02 Color Appearance Model". Scottsdale, Arizona: The Society for Imaging Science and Technology. ISBN 0-89208-241-0. 
  6. Ebner, Fritz (1998-07-01). "Derivation and modelling hue uniformity and development of the IPT color space". Theses: 129. https://scholarworks.rit.edu/theses/2858. 
  7. "Welcome to Bruce Lindbloom's Web Site". http://brucelindbloom.com/index.html?Eqn_ChromAdapt.html. Retrieved 23 March 2020. 
  8. Specification ICC.1:2010 (Profile version 4.3.0.0). Image technology colour management — Architecture, profile format, and data structure, Annex E.3, pp. 102.
  9. Fairchild, Mark D. (2001). "A Revision of CIECAM97s for Practical Applications". Color Research & Application (Wiley Interscience) 26 (6): 418–427. doi:10.1002/col.1061. http://www.cis.rit.edu/fairchild/PDFs/PAP10.pdf. 
  10. Fairchild, Mark. "Errata for COLOR APPEARANCE MODELS". http://markfairchild.org/PDFs/Errata2e.pdf. "The published MCAT02 matrix in Eq. 9.40 is incorrect (it is a version of the HuntPointer-Estevez matrix. The correct MCAT02 matrix is as follows. It is also given correctly in Eq. 16.2)" 
  11. Li, Changjun; Li, Zhiqiang; Wang, Zhifeng; Xu, Yang; Luo, Ming Ronnier; Cui, Guihua; Melgosa, Manuel; Brill, Michael H. et al. (2017). "Comprehensive color solutions: CAM16, CAT16, and CAM16-UCS". Color Research & Application 42 (6): 703–718. doi:10.1002/col.22131. 
  12. "CIE 2006 "physiologically-relevant" LMS functions (2-deg LMS fundamentals based on the Stiles and Burch 10-deg CMFs adjusted to 2-deg)". Institute of Ophthalmology. http://www.cvrl.org/ciepr.htm. 
  13. Stockman, Andrew (December 2019). "Cone fundamentals and CIE standards". Current Opinion in Behavioral Sciences 30: 87–93. http://www.cvrl.org/people/Stockman/pubs/2019%20Cone%20fundamentals%20CIE%20S.pdf. Retrieved 27 October 2023. 
  14. "Photopigments". Institute of Ophthalmology. http://www.cvrl.org/database/text/pigments/ssabance.htm. 
  15. 15.0 15.1 "CIE 2-deg CMFs". http://cvrl.ucl.ac.uk/database/text/cienewxyz/cie2012xyz2.htm. 
  16. "CIE (2012) 2-deg XYZ "physiologically-relevant" colour matching functions". Institute of Ophthalmology. http://www.cvrl.org/ciexyzpr.htm. 
  17. Sharpe, Lindsay T.; Stockman, Andrew; Jagla, Wolfgang; Jägle, Herbert (21 December 2005). "A luminous efficiency function, V*(λ), for daylight adaptation". Journal of Vision 5 (11): 3. doi:10.1167/5.11.3. 
  18. Sharpe, L.T. et al. (February 2011). "A Luminous Efficiency Function, V*D65(λ), for Daylight Adaptation: A Correction". COLOR Research and Application 36 (1): 42–46. doi:10.1002/col.20602. 
  19. Stockman, A.; Sharpe, L.T.; Fach, C.C. (1999). "The spectral sensitivity of the human short-wavelength cones". Vision Research 39: 2901–2927. https://www.sciencedirect.com/science/article/pii/S0042698998002259. Retrieved 28 November 2023. 
  20. "Color Vision Deficiency Emulation" (in en). http://colorspace.r-forge.r-project.org/articles/color_vision_deficiency.html. 
  21. Simon-Liedtke, Joschua Thomas; Farup, Ivar (February 2016). "Evaluating color vision deficiency daltonization methods using a behavioral visual-search method". Journal of Visual Communication and Image Representation 35: 236–247. doi:10.1016/j.jvcir.2015.12.014. 
  22. Alakuijala, Jyrki; van Asseldonk, Ruud; Boukortt, Sami; Szabadka, Zoltan; Bruse, Martin; Comsa, Iulia-Maria; Firsching, Moritz; Fischbacher, Thomas et al. (6 September 2019). "JPEG XL next-generation image compression architecture and coding tools". in Tescher, Andrew G; Ebrahimi, Touradj. Applications of Digital Image Processing XLII. 11137. pp. 20. doi:10.1117/12.2529237. ISBN 9781510629677. Bibcode2019SPIE11137E..0KA. 
  23. "butteraugli/butteraugli.h at master · google/butteraugli" (in en). https://github.com/google/butteraugli.