User:Joger/Color Management: Difference between revisions
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
''Luminance,'' denoted ''Y,'' unit cd·m<sup>-2</sup> (nits) is a linear light quantity that is loosely coupled with what we think of as ''brightness.'' The luminance of a light source is calculated by accumulating its power over its spectrum, weighted by the Y(λ) CIE color matching function. It turns out that this function agrees well with how humans perceive brightness. Mid-range green values will contribute more to the response than red and blue, but all visible colors contribute. For example, if we have three light sources, red, green, and blue, and they each emit the same power, the green light source will appear the brightest, while the blue light source will appear the darkest<ref name="DV" />. This means that formulas that calculates luminance from R, G, and B values, will put more weight on green colors than the other primaries, as shown in the Rec. ITU-R BT.709 which standardizes some classes of displays: <blockquote><sup>709</sup>''Y'' = 0.2126 ''R'' + 0.7152 ''G'' + 0.0722 ''B''</blockquote>Here, luminance gets 21% of its power from red, 72% of its power from green, and 7% of its power from blue<ref name="DV" />. Note that luminance is typically not used in video processing, because we rarely intend to reproduce the absolute luminance of the actual scene<ref name="DV" />. | ''Luminance,'' denoted ''Y,'' unit cd·m<sup>-2</sup> (nits) is a linear light quantity that is loosely coupled with what we think of as ''brightness.'' The luminance of a light source is calculated by accumulating its power over its spectrum, weighted by the Y(λ) CIE color matching function. It turns out that this function agrees well with how humans perceive brightness. Mid-range green values will contribute more to the response than red and blue, but all visible colors contribute. For example, if we have three light sources, red, green, and blue, and they each emit the same power, the green light source will appear the brightest, while the blue light source will appear the darkest<ref name="DV" />. This means that formulas that calculates luminance from R, G, and B values, will put more weight on green colors than the other primaries, as shown in the Rec. ITU-R BT.709 which standardizes some classes of displays: <blockquote><sup>709</sup>''Y'' = 0.2126 ''R'' + 0.7152 ''G'' + 0.0722 ''B''</blockquote>Here, luminance gets 21% of its power from red, 72% of its power from green, and 7% of its power from blue<ref name="DV" />. Note that luminance is typically not used in video processing, because we rarely intend to reproduce the absolute luminance of the actual scene<ref name="DV" />. | ||
=== Relative luminance === | |||
The unit of X, Y, and Z is often arbitrarily chosen so that Y = 1 or Y = 100 is the brightest white that a color display supports. In this case, Y is a relative luminance <ref>[[/en.wikipedia.org/wiki/CIE 1931 color space|CIE 1931 color space - Wikipedia]]</ref>. Relative luminance is a unitless quantity, and is proportional to the scene luminance up to the maximum luminance of the screen/device. | |||
[[File:SRGB color space with colors.png|thumb|The sRGB color space as defined within a CIE XYZ color space]] | |||
=== Defining other color spaces === | |||
Now that we have a reference color space, we can start defining other color spaces which are subsets of the CIE XYZ color space. The Rec. 709 defines a standard for HDTV screens, including their color space. | |||
''''' | This standard defines the '''''white point''''' to be at x = 0.31271 and y = 0.32902, which is known as D<sub>65</sub>. This means that a color at this coordinate is considered the 'reference' white on HDTV screens, and is engineered such that equal amounts of R, G, and B primaries will appear white for a reference observer in a reference environment<ref name=":0">[[/threejs.org/docs/#manual/en/introduction/Color-management|Color management – three.js docs (threejs.org)]]</ref>. | ||
''''' | In addition, the standard defines the '''''color primaries''','' or primaries for short. The primary blue color is at x = 0.15 and y = 0.06, red is at x = 0.64 and y = 0.33, while green is at x = 0.30 and y = 0.60 as illustrated in the CIE chromaticity diagram. The primaries denotes the maximum red, green, or blue that the screen can display. The triangle spanned by the three primaries are called the '''''gamut''''', and the screen can only display colors within this triangle. Any color within the gamut is created by adding different amounts of the primary colors. | ||
''''' | '''''Luma''','' denoted ''Y'<nowiki/>'' , is calculated as a weighted sum of gamma corrected ''R'<nowiki/>'', ''G'<nowiki/>'', and ''B'<nowiki/>'' components<ref name="DV" />. Luma is therefore not a linear quantity. | ||
'''''Transfer functions''''' map numerical coordinates to and from a color space. The transfer functions can be linear, or non-linear. Typical examples of non-linear transfer functions are Gamma 2.2 and the non-linear transfer function defined by sRGB <ref name=":0" />. | '''''Transfer functions''''' map numerical coordinates to and from a color space. The transfer functions can be linear, or non-linear. Typical examples of non-linear transfer functions are Gamma 2.2 and the non-linear transfer function defined by sRGB <ref name=":0" />. | ||
==References== | ==References== | ||
<references /> | <references /> |
Revision as of 20:30, 18 February 2024
This document contains personal draft notes on color management topics, and can not be considered a reference on the topic.
The CIE 1931 XYZ color space
The CIE XYZ 1931 color space lays the foundation for understanding color management concepts such as color spaces, gamut, white point, and transfer functions. Specifically, the CIE color space defines a generic color coordinate system that is used do define other color spaces. This coordinate system consists of three axes, with coordinates x, y, and z. Usually, the z axis is projected onto the x-y plane and looks like the characteristic shark fin. At around its locus we find the colors that corresponds to a monochromatic light source when it is swept from 400 nm to 700 nm.
The point of the CIE 1931 XYZ color space is that it gives every visible color a well-defined (x, y) coordinate. This is important when we derive other color spaces, such as the sRGB color space, because concepts such as primary colors, gamut, and white point are defined based upon the corresponding (x, y) coordinate in the CIE coordinate system. Having a common reference becomes particularly important when we need to convert between different color spaces.
Derivation of the CIE XYZ coordinate system [1]
The idea behind the CIE 1931 XYZ color space is that to be able to reproduce colors, a camera needs 3 different sensors, each responding to different wavelengths of light. Since light exists across a spectrum of frequencies, such sensors needs to respond to a wide range of wavelengths, although its sensitivity is highest at a specific frequency, and falls off for higher and lower frequencies. The CIE 1931 matching functions X(λ), Y(λ) and Z(λ) defines the response of a 3 sensor camera that is able to capture all visible colors, and these matching functions defines the CIE color space. We find the response of a single sensor as an integral over the spectrum of the light source and its corresponding matching function. For example, if a source emits light in a spectrum between 560 and 660 nm, a sensor with the characteristics of the X(λ) or Y(λ) matching functions will get a response, whereas the sensor following the Z(λ) matching function will have almost no response.
Given an input spectrum of light (colors), we calculate the CIE tristimulus values X, Y, and Z by accumulating its emission power at each discrete frequency, weighted by the corresponding CIE 1931 matching function. If an analog sensor was following perfectly one of the matching functions, the calculated value would roughly correspond to the output voltage of the sensor.
In color management, it is beneficial to remove the absolute power of the output values by normalizing them against the total power from all the sensors:
x = X / (X + Y + Z) y = Y / (X + Y + Z) z = Z / (X + Y + Z)
The x, y, and z values are known as CIE chromaticity, and the x and y coordinates corresponds to the axes of the CIE 1931 chromaticity diagram. In practice z is redundant because x + y + z = 1. Also note that the x, y, and z chromaticity coordinates are abstract values, and have no direct physical interpretation[1].
Luminance
Luminance, denoted Y, unit cd·m-2 (nits) is a linear light quantity that is loosely coupled with what we think of as brightness. The luminance of a light source is calculated by accumulating its power over its spectrum, weighted by the Y(λ) CIE color matching function. It turns out that this function agrees well with how humans perceive brightness. Mid-range green values will contribute more to the response than red and blue, but all visible colors contribute. For example, if we have three light sources, red, green, and blue, and they each emit the same power, the green light source will appear the brightest, while the blue light source will appear the darkest[1]. This means that formulas that calculates luminance from R, G, and B values, will put more weight on green colors than the other primaries, as shown in the Rec. ITU-R BT.709 which standardizes some classes of displays:
709Y = 0.2126 R + 0.7152 G + 0.0722 B
Here, luminance gets 21% of its power from red, 72% of its power from green, and 7% of its power from blue[1]. Note that luminance is typically not used in video processing, because we rarely intend to reproduce the absolute luminance of the actual scene[1].
Relative luminance
The unit of X, Y, and Z is often arbitrarily chosen so that Y = 1 or Y = 100 is the brightest white that a color display supports. In this case, Y is a relative luminance [2]. Relative luminance is a unitless quantity, and is proportional to the scene luminance up to the maximum luminance of the screen/device.
Defining other color spaces
Now that we have a reference color space, we can start defining other color spaces which are subsets of the CIE XYZ color space. The Rec. 709 defines a standard for HDTV screens, including their color space.
This standard defines the white point to be at x = 0.31271 and y = 0.32902, which is known as D65. This means that a color at this coordinate is considered the 'reference' white on HDTV screens, and is engineered such that equal amounts of R, G, and B primaries will appear white for a reference observer in a reference environment[3].
In addition, the standard defines the color primaries, or primaries for short. The primary blue color is at x = 0.15 and y = 0.06, red is at x = 0.64 and y = 0.33, while green is at x = 0.30 and y = 0.60 as illustrated in the CIE chromaticity diagram. The primaries denotes the maximum red, green, or blue that the screen can display. The triangle spanned by the three primaries are called the gamut, and the screen can only display colors within this triangle. Any color within the gamut is created by adding different amounts of the primary colors.
Luma, denoted Y' , is calculated as a weighted sum of gamma corrected R', G', and B' components[1]. Luma is therefore not a linear quantity.
Transfer functions map numerical coordinates to and from a color space. The transfer functions can be linear, or non-linear. Typical examples of non-linear transfer functions are Gamma 2.2 and the non-linear transfer function defined by sRGB [3].