LMS Color Space
   HOME

TheInfoList



OR:

LMS (long, medium, short), is a
color space A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represe ...
which represents the response of the three types of
cones In geometry, a cone is a three-dimensional figure that tapers smoothly from a flat base (typically a circle) to a point not contained in the base, called the ''apex'' or '' vertex''. A cone is formed by a set of line segments, half-lines, ...
of the
human eye The human eye is a sensory organ in the visual system that reacts to light, visible light allowing eyesight. Other functions include maintaining the circadian rhythm, and Balance (ability), keeping balance. The eye can be considered as a living ...
, named for their
responsivity Responsivity is a measure of the input–output Gain (electronics), gain of a detector system. In the specific case of a photodetector, it measures the electrical output per optical input. A photodetector's responsivity is usually expressed in un ...
(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 Chromatic adaptation is the human visual system’s ability to adjust to changes in illumination in order to preserve the appearance of object colors. It is responsible for the stable appearance of object colors despite the wide variation of light ...
(estimating the appearance of a sample under a different illuminant). It is also useful in the study of
color blindness Color blindness, color vision deficiency (CVD) or color deficiency is the decreased ability to color vision, see color or differences in color. The severity of color blindness ranges from mostly unnoticeable to full absence of color percept ...
, when one or more cone types are defective.


Definition

The cone response functions \bar(\lambda), \bar(\lambda),\bar(\lambda) are the color matching functions (CMFs) for the LMS color space. The chromaticity coordinates (L, M, S) for a spectral distribution J(\lambda) are defined as: : L = \int^\infty_0 J(\lambda)\bar(\lambda)d\lambda : M = \int^\infty_0 J(\lambda)\bar(\lambda)d\lambda : S = \int^\infty_0 J(\lambda)\bar(\lambda)d\lambda 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 sRGB (standard RGB) is a colorspace, for use on monitors, printers, and the World Wide Web. It was initially proposed by HP and Microsoft in 1996 and became an official standard of the International Electrotechnical Commission (IEC) as IEC 6 ...
). The chromatic adaptation matrix in the diagonal
von Kries transform Chromatic adaptation is the human visual system’s ability to adjust to changes in illumination in order to preserve the appearance of object colors. It is responsible for the stable appearance of object colors despite the wide variation of light ...
method, however, operates on
tristimulus In 1931, the International Commission on Illumination (CIE) published the CIE 1931 color spaces which define the relationship between the visible spectrum and human color vision. The CIE color spaces are mathematical models that comprise a "stan ...
values in the LMS color space. Since colors in most colorspaces can be transformed to the XYZ color space, only one additional
transformation matrix In linear algebra, linear transformations can be represented by matrices. If T is a linear transformation mapping \mathbb^n to \mathbb^m and \mathbf x is a column vector with n entries, then there exists an m \times n matrix A, called the transfo ...
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 In 1931, the International Commission on Illumination (CIE) published the CIE 1931 color spaces which define the relationship between the visible spectrum and human color vision. The CIE color spaces are mathematical models that comprise a "stan ...
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. * 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

The
Hunt Hunting is the Human activity, human practice of seeking, pursuing, capturing, and killing wildlife or feral animals. The most common reasons for humans to hunt are to obtain the animal's body for meat and useful animal products (fur/hide (sk ...
and RLAB color appearance models use the Hunt–Pointer–Estevez transformation matrix (MHPE) for conversion from CIE XYZ to LMS. 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 L\\M\\S \end_\text = \left begin \phantom0.38971 & \phantom0.68898 & -0.07868\\ -0.22981 & \phantom1.18340 & \phantom0.04641\\ \phantom0 & \phantom0 & \phantom1 \end\right\begin X\\Y\\Z \end * Normalized to D65: \begin L\\M\\S \end_ = \left begin \phantom0.4002 & \phantom0.7076 & -0.0808 \\ -0.2263 & \phantom1.1653 & \phantom0.0457 \\ \phantom0 & \phantom0 & \phantom0.9182 \end\right\begin X\\Y\\Z \end


Bradford's spectrally sharpened matrix (LLAB, CIECAM97s)

The original
CIECAM97s A color appearance model (CAM) is a mathematical model that seeks to describe the perceptual aspects of human color vision, i.e. viewing conditions under which the appearance of a color does not tally with the corresponding physical measurement of ...
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.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 R \\ G \\ B \end_\text = \left begin \phantom0.8951 & \phantom0.2664 & -0.1614 \\ -0.7502 & \phantom1.7135 & \phantom0.0367 \\ \phantom0.0389 & -0.0685 & \phantom1.0296 \end\right\begin X \\ Y \\ Z \end 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): \begin R\\G\\B \end_\text = \left begin \phantom0.8562 & \phantom0.3372 & -0.1934 \\ -0.8360 & \phantom1.8327 & \phantom0.0033 \\ \phantom0.0357 & -0.0469 & \phantom1.0112 \end\right\begin X\\Y\\Z \end The sharpened transformation matrix in
CIECAM02 In colorimetry, CIECAM02 is the color appearance model published in 2002 by the International Commission on Illumination (CIE) Technical Committee 8-01 (''Color Appearance Modelling for Color Management Systems'') and the successor of Color appe ...
(MCAT02) is: \begin R\\G\\B \end_\text = \left begin \phantom0.7328 & \phantom0.4296 & -0.1624\\ -0.7036 & \phantom1.6975 & \phantom0.0061\\ \phantom0.0030 & \phantom0.0136 & \phantom0.9834 \end\right\begin X\\Y\\Z \end CAM16 uses a different matrix: \begin R\\G\\B \end_\text = \left begin \phantom0.401288 & \phantom0.650173 & -0.051461 \\ -0.250268 & \phantom1.204414 & \phantom0.045854 \\ -0.002079 & \phantom0.048952 & \phantom0.953127 \end\right\begin X\\Y\\Z \end 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). 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 A lens is a transmissive optical device that focuses or disperses a light beam by means of refraction. A simple lens consists of a single piece of transparent material, while a compound lens consists of several simple lenses (''elements'') ...
and the
macula lutea The macula (/ˈmakjʊlə/) or macula lutea is an oval-shaped pigmented area in the center of the retina of the human eye and in other animals. The macula in humans has a diameter of around and is subdivided into the umbo, foveola, foveal av ...
are used. The Stockman & Sharpe functions can then be turned into a set of three color-matching functions similar to the CIE 1931 functions. Let \mathcal_i(\lambda)=(\bar(\lambda), \bar(\lambda),\bar(\lambda)) be the three cone response functions, and let \mathcal_i(\lambda)=(\bar_\text(\lambda), \bar_\text(\lambda),\bar_\text(\lambda)) be the new XYZ color matching functions. Then, by definition, the new XYZ color matching functions are: : \mathcal_i(\lambda)=\sum_^3 T_\mathcal_j(\lambda) where the transformation matrix T_ is defined as: T_= \left ,\begin 1.94735469 & -1.41445123 & \phantom0.36476327 \\ 0.68990272 & \phantom0.34832189 & \phantom0 \\ 0 & \phantom0 & \phantom1.93485343 \end\right For any spectral distribution J(\lambda), let P_i=(L,M,S) be the LMS chromaticity coordinates for J(\lambda), and let Q_i=(X,Y,Z)_\text be the corresponding new XYZ chromaticity coordinates. Then: : Q_i = \int^\infty_0 J(\lambda)\mathcal_i(\lambda)d\lambda = \int^\infty_0 J(\lambda) \sum_^3 T_ \mathcal_j(\lambda)d\lambda = \sum_^3 T_P_j or, explicitly: \begin X \\ Y \\ Z \end_ = \left ,\begin 1.94735469 & -1.41445123 & \phantom0.36476327 \\ 0.68990272 & \phantom0.34832189 & \phantom0 \\ 0 & \phantom0 & \phantom1.93485343 \end\right\begin L\\M\\S \end The inverse matrix is shown here for comparison with the ones for traditional XYZ: \begin L\\M\\S \end = \left begin \phantom0.210576 & \phantom0.855098 & -0.0396983 \\ -0.417076 & \phantom1.177260 & \phantom0.0786283 \\ \phantom0 & \phantom0 & \phantom0.5168350 \\ \end\right\begin X\\Y\\Z \end_ 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 J(\lambda) ) 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

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 The Planck relationFrench & Taylor (1978), pp. 24, 55.Cohen-Tannoudji, Diu & Laloë (1973/1977), pp. 10–11. (referred to as Planck's energy–frequency relation,Schwinger (2001), p. 203. the Planck–Einstein relation, Planck equation, and Plan ...
: E = h \nu = h c/\lambda where ''E'' is the energy per photon, ''h'' is the
Planck constant The Planck constant, or Planck's constant, denoted by h, is a fundamental physical constant of foundational importance in quantum mechanics: a photon's energy is equal to its frequency multiplied by the Planck constant, and the wavelength of a ...
, ''c'' is the
speed of light The speed of light in vacuum, commonly denoted , is a universal physical constant exactly equal to ). It is exact because, by international agreement, a metre is defined as the length of the path travelled by light in vacuum during a time i ...
, ''ν'' 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: : JQ(\lambda) = JE(\lambda) (\lambda/hc) For example, if ''JE''(''λ'') is
spectral radiance In radiometry, spectral radiance or specific intensity is the radiance of a surface per unit frequency or wavelength, depending on whether the Spectral radiometric quantity, spectrum is taken as a function of frequency or of wavelength. The Interna ...
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: : CE_i = \int_0^\infty JE(\lambda) CE_(\lambda) d\lambda = \int_0^\infty JQ(\lambda)(hc/\lambda) CE_(\lambda) d\lambda Define the quantal color matching functions: : CQ_(\lambda) = (CE_(\lambda)/\lambda)/(CE_(\lambda_)/\lambda_) where ''λ''''i'' max is the wavelength at which ''CE''''λ'' ''i''(''λ'')/''λ'' is maximized. Define the quantal tristimulus values: : CQ_i = \int_0^\infty JQ(\lambda) CQ_(\lambda) d\lambda 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'' : CE_i = (hc/\lambda_)\,CE_(\lambda_)\, CQ_i For the LMS color space, \lambda_ ≈ nm and : CE_i/CQ_i = \ \times 10^ 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. A related application is making color filters for color-blind people to more easily notice differences in color, a process known as ''daltonization''.


Image processing

JPEG XL The JPEG XL Image Coding System is a royalty-free open standard for a image compression, compressed Raster graphics, raster image format. It defines a graphics file format and the abstract device for coding JPEG XL bitstreams. It is developed by t ...
uses an XYB color space derived from LMS. Its transform matrix is shown here: \begin X\\Y\\B \end = \begin 1 & -1 & \phantom0 \\ 1 & \phantom1 & \phantom0 \\ 0 & \phantom0 & \phantom1 \end \begin L\\M\\S \end 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. The colorspace originates from Guetzli's butteraugli metric and was passed down to JPEG XL via Google's Pik project. Matt DesLauriers has produced a
Gist In computing, GiST or Generalized Search Tree, is a data structure and API that can be used to build a variety of disk-based search trees. GiST is a generalization of the B+ tree, providing a concurrent and recoverable height-balanced search tree ...
with the relevant parts from the reference implementation of JPEG XL translated into JavaScript.


See also

*
Color balance In photography and image processing, color balance is the global adjustment of the intensities of the colors (typically red, green, and blue primary colors). An important goal of this adjustment is to render specific colors – particularly neu ...
*
Color vision Color vision, a feature of visual perception, is an ability to perceive differences between light composed of different frequencies independently of light intensity. Color perception is a part of the larger visual system and is mediated by a co ...
*
Luminous efficiency function A luminous efficiency function or luminosity function represents the average spectral sensitivity of human visual perception of light. It is based on subjective judgements of which of a pair of different-colored lights is brighter, to describe re ...
*
Trichromacy Trichromacy or trichromatism is the possession of three independent channels for conveying color information, derived from the three different types of cone cells in the eye. Organisms with trichromacy are called trichromats. The normal expl ...


References

{{Color space Color space Color blindness