LMS color space
{{short description|Color space represented by the response of the three types of cones of the human eye}}
{{Use American English|date=March 2021}}
{{Use mdy dates|date=March 2021}}
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 is also useful in the study of color blindness, when one or more cone types are defective.
Definition
The cone response functions are the color matching functions (CMFs) for the LMS color space. The chromaticity coordinates (L, M, S) for a spectral distribution are defined as:
:
:
:
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.
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.
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:
- All tristimulus values are normally calculated using the CIE 1931 2° standard colorimetric observer.{{cite book|first=Mark D.|last=Fairchild|title=Color Appearance Models| publisher=Wiley Interscience|isbn=978-0-470-01216-1|year=2005|edition=2E|url=https://books.google.com/books?id=8_TxzK2B-5MC&q=hunt+model+tristimulus+matrix&pg=PA228|pages=182–183, 227–230}}
- Unless specified otherwise, the CAT matrices are normalized (the elements in a row add up to 1) so the tristimulus values for an equal-energy illuminant (X=Y=Z), like CIE Illuminant E, produce equal LMS values.
= Hunt, RLAB =
{{missing information|how the HPE matrix was derived – looks like the most "physiological" of the XYZ bunch, but where's the data?|date=October 2021}}
The Hunt and RLAB color appearance models use the Hunt–Pointer–Estevez transformation matrix (MHPE) for conversion from CIE XYZ to LMS.{{Cite book|date=2007-07-27|editor-last=Schanda|editor-first=Jnos| title=Colorimetry| language=en| pages=305| doi=10.1002/9780470175637|isbn=9780470175637}}{{cite conference|title=The CIECAM02 Color Appearance Model|book-title=IS&T/SID Tenth Color Imaging Conference|last=Moroney|first=Nathan|author2=Fairchild, Mark D.|author3=Hunt, Robert W.G.| author4=Li, Changjun|author5=Luo, M. Ronnier|author6=Newman, Todd|location=Scottsdale, Arizona| isbn=0-89208-241-0| date=November 12, 2002|publisher=The Society for Imaging Science and Technology}}{{Cite journal|last=Ebner|first=Fritz|date=1998-07-01|title=Derivation and modelling hue uniformity and development of the IPT color space|url=https://scholarworks.rit.edu/theses/2858|journal=Theses|pages=129}} 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:
\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}
- Normalized{{cite web |title=Welcome to Bruce Lindbloom's Web Site |url=http://brucelindbloom.com/index.html?Eqn_ChromAdapt.html |website=brucelindbloom.com |accessdate=23 March 2020}} to D65:
\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}
= 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). 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.[https://www.color.org/specification/ICC1v43_2010-12.pdf 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.
\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}
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):{{cite journal|journal=Color Research & Application|title=A Revision of CIECAM97s for Practical Applications|first=Mark D.|last=Fairchild|url=http://www.cis.rit.edu/fairchild/PDFs/PAP10.pdf | publisher=Wiley Interscience|volume=26|date=2001|issue=6|pages=418–427|doi=10.1002/col.1061}}
\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}
The sharpened transformation matrix in CIECAM02 (MCAT02) is:{{Cite web|url=http://markfairchild.org/PDFs/Errata2e.pdf|title=Errata for COLOR APPEARANCE MODELS|last=Fairchild|first=Mark|quote=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)}}
\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}
\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}
As in CIECAM97s, after adaptation, the colors are converted to the traditional Hunt–Pointer–Estévez LMS for final prediction of visual results.
{{vanchor|Stockman & Sharpe (2000)}} 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).{{cite web |url=http://www.cvrl.org/ciepr.htm |title=CIE 2006 "physiologically-relevant" LMS functions (2-deg LMS fundamentals based on the Stiles and Burch 10-deg CMFs adjusted to 2-deg)|last= |first= |date= |website=Color & Vision Research Laboratory/ |publisher=Institute of Ophthalmology |access-date=27 October 2023 |quote=}}{{cite journal |last1=Stockman |first1=Andrew|date=December 2019 |title=Cone fundamentals and CIE standards |url=http://www.cvrl.org/people/Stockman/pubs/2019%20Cone%20fundamentals%20CIE%20S.pdf |journal=Current Opinion in Behavioral Sciences |volume=30 |issue= |pages=87–93 |doi= 10.1016/j.cobeha.2019.06.005|access-date=27 October 2023}} The functions are derived from Stiles and Burch 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.{{cite web |url=http://www.cvrl.org/database/text/pigments/ssabance.htm |title=Photopigments|last= |first= |date= |website=Color & Vision Research Laboratory/ |publisher=Institute of Ophthalmology |access-date=27 November 2023 |quote=}}
File:XYZ color matching functions, CIE 1931 and Stockman & Sharpe 2006.jpg
The Stockman & Sharpe functions can then be turned into a set of three color-matching functions similar to the CIE 1931 functions.{{cite web |title=CIE 2-deg CMFs |url=http://cvrl.ucl.ac.uk/database/text/cienewxyz/cie2012xyz2.htm |website=cvrl.ucl.ac.uk}}
Let be the three cone response functions, and let be the new XYZ color matching functions. Then, by definition, the new XYZ color matching functions are:
:
where the transformation matrix is defined as:
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]
{{Quote frame
|text=The derivation of this transformation is relatively straightforward.{{cite web |url=http://www.cvrl.org/ciexyzpr.htm |title=CIE (2012) 2-deg XYZ "physiologically-relevant" colour matching functions|last= |first= |date= |website=Color & Vision Research Laboratory/ |publisher=Institute of Ophthalmology |access-date=27 November 2023 |quote=}} The CMF is the luminous efficiency function originally proposed by Sharpe et al. (2005),{{cite journal |last1=Sharpe |first1=Lindsay T. |last2=Stockman |first2=Andrew |last3=Jagla |first3=Wolfgang |last4=Jägle |first4=Herbert |title=A luminous efficiency function, V*(λ), for daylight adaptation |journal=Journal of Vision |date=21 December 2005 |volume=5 |issue=11 |pages=3 |doi=10.1167/5.11.3 |s2cid=19361187}} but then corrected (Sharpe et al., 2011{{cite journal |last1=Sharpe |first1=L.T. |last2=Stockman |first2=A. |display-authors=etal|date=February 2011 |title=A Luminous Efficiency Function, V*D65(λ), for Daylight Adaptation: A Correction |journal=COLOR Research and Application |volume=36 |issue=1 |pages=42–46 |doi=10.1002/col.20602 |doi-access=free}}{{efn|2011 correction is taken into account with the CIE (2012) matrix.}}). The CMF is equal to the cone fundamental originally proposed by Stockman, Sharpe & Fach (1999){{cite journal|last1=Stockman |first1=A. |last2=Sharpe|first2=L.T.|last3=Fach |first3=C.C. |date=1999 |title=The spectral sensitivity of the human short-wavelength cones |url=https://www.sciencedirect.com/science/article/pii/S0042698998002259 |journal=Vision Research |volume=39 |issue= 17|pages=2901–2927 |doi= 10.1016/S0042-6989(98)00225-9|pmid=10492818 |access-date=28 November 2023}} scaled to have an integral equal to the CMF. The definition of the CMF is derived from the following constraints:
- Like the other CMFs, the values of are all positive.
- The integral of is identical to the integrals for and .
- The coefficients of the transformation that yields are optimized to minimize the Euclidean differences between the resulting , and color matching functions and the CIE 1931 , and color matching functions.
|source=CVRL description for 'CIE (2012) 2-deg XYZ "physiologically-relevant" colour matching functions'}}
For any spectral distribution , let be the LMS chromaticity coordinates for , and let be the corresponding new XYZ chromaticity coordinates. Then:
:
or, explicitly:
\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}
The inverse matrix is shown here for comparison with the ones for traditional XYZ:
\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}}
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 ) 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 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.
Quantal CMF
{{unreferenced section|date=June 2024}}
For theoretical purposes, it is often convenient to characterize radiation in terms of photons rather than energy. The energy E of a photon is given by the Planck relation
:
where E is the energy per photon, h is the Planck constant, c is the speed of light, ν is the frequency of the radiation and λ is the wavelength. A spectral radiative quantity in terms of energy, JE(λ), is converted to its quantal form JQ(λ) by dividing by the energy per photon:
:
For example, if JE(λ) is spectral radiance with the unit W/m2/sr/m, then the quantal equivalent JQ(λ) characterizes that radiation with the unit photons/s/m2/sr/m.
If CEλi(λ) (i=1,2,3) are the three energy-based color matching functions for a particular color space (LMS color space for the purposes of this article), then the tristimulus values may be expressed in terms of the quantal radiative quantity by:
:
= \int_0^\infty JQ(\lambda)(hc/\lambda) CE_{\lambda i}(\lambda) d\lambda
Define the quantal color matching functions:
:
where λi max is the wavelength at which CEλ i(λ)/λ is maximized. Define the quantal tristimulus values:
:
Note that, as with the energy based functions, the peak value of CQλi(λ) will be equal to unity. Using the above equation for the energy tristimulus values CEi
:
For the LMS color space, ≈ {566, 541, 441} nm and
: J/photon
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.{{cite web |title=Color Vision Deficiency Emulation |url=http://colorspace.r-forge.r-project.org/articles/color_vision_deficiency.html |website=colorspace.r-forge.r-project.org |language=en}}
A related application is making color filters for color-blind people to more easily notice differences in color, a process known as daltonization.{{cite journal |last1=Simon-Liedtke |first1=Joschua Thomas |last2=Farup |first2=Ivar |title=Evaluating color vision deficiency daltonization methods using a behavioral visual-search method |journal=Journal of Visual Communication and Image Representation |date=February 2016 |volume=35 |pages=236–247 |doi=10.1016/j.jvcir.2015.12.014|hdl=11250/2461824 |hdl-access=free }}
= Image processing =
JPEG XL uses an XYB color space derived from LMS. Its transform matrix is shown here:
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}
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.{{cite book |last1=Alakuijala |first1=Jyrki |last2=van Asseldonk |first2=Ruud |last3=Boukortt |first3=Sami |last4=Szabadka |first4=Zoltan |last5=Bruse |first5=Martin |last6=Comsa |first6=Iulia-Maria |last7=Firsching |first7=Moritz |last8=Fischbacher |first8=Thomas |last9=Kliuchnikov |first9=Evgenii |last10=Gomez |first10=Sebastian |last11=Obryk |first11=Robert |last12=Potempa |first12=Krzysztof |last13=Rhatushnyak |first13=Alexander |last14=Sneyers |first14=Jon |last15=Szabadka |first15=Zoltan |last16=Vandervenne |first16=Lode |last17=Versari |first17=Luca |last18=Wassenberg |first18=Jan |title=Applications of Digital Image Processing XLII |chapter=JPEG XL next-generation image compression architecture and coding tools |editor1-first=Andrew G |editor1-last=Tescher |editor2-first=Touradj |editor2-last=Ebrahimi |date=6 September 2019 |volume=11137 |pages=20 |doi=10.1117/12.2529237 | bibcode=2019SPIE11137E..0KA |isbn=9781510629677 |doi-access=free }}
The colorspace originates from Guetzli's butteraugli metric{{Cite web|title=google/butteraugli|url=https://github.com/google/butteraugli|access-date=2021-08-02|website=GitHub|language=en}} and was passed down to JPEG XL via Google's Pik project. Matt DesLauriers has produced a Gist with the relevant parts from the reference implementation of JPEG XL translated into JavaScript.{{cite web |last1=DesLauriers |first1=Matt |title=rgb-to-xyb.js |url=https://gist.github.com/mattdesl/c0ad8d54b3491c7fd39e222e698b2a30 |website=Gist |language=en}}