A summary of the essential color spaces you should know: XYZ, RGB, ICC, xyY, and TRC.



Image editing software allows you to specify colors using RGB values such as 'R: 255, G: 0, B: 0'. However, even with the same RGB values, the actual color displayed will differ depending on the color space being used, such as sRGB or ProPhotoRGB. Digital photographer Elle Stone explains XYZ, RGB, ICC, xyY, and TRC, which are necessary for understanding image processing and color management, on his website.

Completely Painless Programmer's Guide to XYZ, RGB, ICC, xyY, and TRCs

https://ninedegreesbelow.com/photography/xyz-rgb.html



◆1: XYZ color space: The foundation for numerically representing the colors that humans can see.
Stone first explains that it is necessary to distinguish between 'light' and 'color.' 'Light' is a physical phenomenon that comes from light sources such as the sun or light bulbs, while 'color' is a perception that arises when light enters the eye and is processed by the retina and brain. The brain interprets differences in the wavelength of light as differences in color and differences in the intensity of light as differences in brightness. In the late 1920s, William David Wright and John Guild, British color vision and optics researchers, conducted color matching experiments to investigate what colors humans can distinguish, and based on the results of these experiments, the ' CIE 1931 XYZ color space (XYZ color space)' was created in 1931.

To visualize the XYZ color space, it's helpful to think of it as a three-dimensional coordinate space where one color is represented by three numerical values: X, Y, and Z. While the RGB color space represents color using the amounts of red, green, and blue, the X, Y, and Z in the XYZ color space are not actual primary colors themselves, but rather components that quantify how the human eye reacts to light of various wavelengths. Of these, Y corresponds to relative luminance, or brightness, but it's not as simple as saying that Y alone represents brightness and X and Z alone represent hue.

The XYZ color space includes not only colors visible to humans but also numerical colors invisible to humans. Stone refers to the former as 'real colors' and the latter as 'imaginary colors.' While the XYZ color space is rarely specified directly in image editing, it is used as a standard when converting colors between different color spaces in image editing apps that support color management.

The following is a three-dimensional representation of real colors in the XYZ color space. In the XYZ color space, one color is represented by three numerical values, X, Y, and Z, so it can be considered as a more three-dimensional coordinate space than the RGB color space or the xy chromaticity diagram.


by

Michael Horvath (SharkD), Christoph Lipka

◆2: RGB color space: A system that places red, green, and blue within the XYZ color space.
The RGB color space, commonly used in digital images, is a subset of the colors contained within the XYZ color space, making it easier to handle. In the RGB color space used in typical image editing, the white point and the primary colors of red, green, and blue are defined, and the RGB values determine which colors on the XYZ coordinate system correspond to. Black is usually treated as the baseline when all RGB values are 0.

The XYZ coordinates for white are called the 'white point,' and the XYZ coordinates for black are called the 'black point.' The XYZ coordinates for red, green, and blue represent the primary colors used in that RGB color space. Once these three primary colors are determined, the range of colors that can be represented in that RGB color space is also determined, such as 'magenta' (a mixture of red and blue), 'yellow' (a mixture of red and green), and 'cyan' (a mixture of blue and green).

Stone cites two RGB color spaces, 'LargeRGB' and 'SmallRGB,' as examples to demonstrate that RGB values are relative to a color space. In both LargeRGB and SmallRGB, the RGB value for the reddest color is 'RGB = (1,0,0),' but because the XYZ coordinates of the primary color red are different, the actual red represented is not the same. The RGB value alone does not determine what color a color is; only by knowing which RGB color space the value belongs to can we determine which color on the XYZ plane the RGB value corresponds to.

The graph below shows the primary colors of red, green, and blue in the widely used standard RGB color space ' sRGB ' and ' WideGamutRGB ,' which has a wider color gamut than sRGB, on an xy chromaticity diagram . The black dots and lines represent sRGB, and the blue dots and lines represent WideGamutRGB. The red in sRGB is more orange and has lower saturation than in WideGamutRGB, and the green in sRGB is more yellow and has significantly lower saturation than in WideGamutRGB. Also, the blue in WideGamutRGB is more purple and has higher saturation than in sRGB, showing how 'red,' 'green,' and 'blue' change depending on the color space.



◆3: ICC Profile: A mechanism for handling the RGB color space according to the D50 standard.
The XYZ color space was created in 1931, but the International Color Consortium (ICC), which develops

the ICC profile standard, was established in 1993. The RGB color space was used before the advent of ICC profiles, but when ICC profiles link the RGB color space to the XYZ color space, a reference white called 'D50' is used. Reference white is the standard for what is considered 'white,' and Stone describes D50 as 'a color close to direct sunlight on a sunny early morning' and D65 as 'a color close to scattered light on a slightly cloudy midday.'

If you use D50 as the base white, D65 will appear blue, and if you use D65 as the base white, D50 will appear yellow. Therefore, if you change the base white, you need to change the other colors accordingly. Stone explains with an example, 'It's natural for someone's face to appear warm-toned under candlelight, but if their face appears the same warm-toned under cold, bluish, rainy outdoor conditions, it's as if that person is always illuminated by candlelight.'

ICC adopted D50 because it is used as a standard when evaluating printed photographs and other images. Since ICC profiles handle not only on-screen colors but also printed colors, D50, which is suited to the environment in which printed materials are viewed, is used as a common standard. On the other hand, the white point of the sRGB color space itself is 'D65,' so the white point of the sRGB color space and the standard white used in ICC profiles need to be considered separately.

◆4: xyY: See 'which colors can be handled' using the chromaticity diagram.
xyY is a conversion of XYZ color space information into a different form. In the XYZ color space, brightness and hue information are treated as 3D coordinates, but in xyY, x and y represent hue, and Y represents brightness. Therefore, it is possible to separate the brightness information and place only the hue in a 2D diagram.

The tool used in this process is the 'xy chromaticity diagram,' which is shaped like a horse's hoof. The xy chromaticity diagram is a two-dimensional map that shows the range of colors that humans can see, with the area inside the curves representing real colors that humans can see and the area outside representing virtual colors that humans cannot see.

The following diagram shows sRGB, CIE-RGB, ProPhotoRGB, AllColors-RGB, and Identity-RGB superimposed on an xy chromaticity diagram. In each RGB color space, the area inside the triangle formed by connecting the primary colors red, green, and blue represents the range of colors that can be represented in that color space. Conversely, colors outside the triangle are 'out-of-gamut' colors that cannot be represented in that RGB color space.



In image editing, you sometimes have to choose which RGB color space to use for the image you're working on. Using a wider RGB color space makes it easier to handle vibrant colors, but it doesn't mean that you can handle all real-world colors just by expanding the RGB color space.

According to Stone, WideGamutRGB is the largest RGB color space that uses only real colors as primary colors, but even then, some greens and cyans, and some purplish blues and magentas remain outside the triangle. To create an RGB color space that includes all real colors, it is necessary to place some of the red, green, and blue primary colors in the position of virtual colors. For example, AllColors-RGB and Identity-RGB include all real colors, but also virtual colors that are invisible to humans.

◆5: TRC: A curve that correlates RGB values with perceived brightness.
To understand color spaces, the 'Tone Response Curve (TRC),' which correlates RGB values with perceived brightness, is also important. The TRC is a curve that determines how a color changes from black to white when an RGB value changes from 0 to 1.

Human perception of brightness isn't simply proportional to the amount of light. Turning on the first light bulb in a completely dark room makes a big difference, but adding another bulb when many are already lit makes almost no noticeable difference. TRC (Transparency Range Correction) is used to adjust how finely tonal gradations are assigned to dark and bright areas, in accordance with how humans perceive light.

Commonly used TRCs include 'linear gamma,' 'gamma=1.8,' 'gamma=2.2,' 'TRC used in sRGB,' and 'L-star.' Linear gamma is mathematically simple because it directly deals with the amount of light, but it does not result in a uniform gradation change to the human eye. In contrast, L-star's TRC is designed so that the change in perceived brightness is perceptually uniform, and the TRC used in sRGB is also said to be perceptually uniform, being close to 'gamma=2.2.'

The images below show gradients from black to white created using, from top to bottom, 'linear gamma TRC,' 'sRGB TRC,' and 'L-star TRC,' respectively.



With linear gamma, more of the numerical values are assigned to the brighter side, so in 8-bit images, the gradation in dark areas and midtones tends to be coarse, making it difficult to represent smoothly. Therefore, in 8-bit image editing in the 1990s, it was necessary to use a perceptually nearly uniform TRC to avoid 'posterization,' which causes band-like steps in dark areas, Stone explains. On the other hand, with 16-bit integer images and 32-bit floating-point processing, the number of gradations that can be handled increases significantly, so even when using a linear gamma TRC, gradation breakdown is less likely to occur.

Throughout the article, Stone explains that the color of a digital image is not determined solely by RGB values, but requires an understanding of different mechanisms such as XYZ color space, RGB color space, ICC profile, xy chromaticity diagram, and TRC. Distinguishing between these makes it easier to understand why the same RGB values can appear differently depending on the color space and profile.

in Software,   Science,   Design, Posted by log1b_ok