Close

Color Space

Overviewedit

This article is still a work in in progress.

A Color Space defines what 'true' color an RGB value specifies. For example, what light wavelength should (1, 0, 0) create out of your display device. Different color spaces will produce a different shade of red when (1, 0, 0) is converted into light. To ensure an image produces the same colors when shown on one display device vs. another display device, an image/movie must include information about what color space it was saved in. That way an application can ensure the correct values are sent to display. For example (1, 0, 0) on one device, then taken to another device that can show deeper shades of red, may need to be sent (0.8, 0, 0), to achieve the same final color of red. Without that color space information, the image will look more saturated (redder) on the second display, than on the first display.

The same is true for devices that capture images such as cameras. They need to specify what color space they are saving their data in, so anyone consuming the content can display it properly.

Display devices can only display a small portion of colors compared to what the human eye can see. For example the sRGB color space, which most commercial computer monitors are limited to, is only 35% of the colors the human eye can actually see.

A Primer on Coloredit

The range of colors visible by the human eye was tested and recorded in the CIE 1931 color space. This 2D graph is used to help specify visible color gamuts (one of the two main parts of a color space) by specifying triangles on that chart. For example sRGB can be seen as a triangle much smaller than the human visible range. Most monitor can produce colors within that triangle. Higher end monitors and HDR TVs, often can product colors within the larger DCI-P3 triangle. The Rec.2020 gamut is used often when communicating between applications/devices, since it a very large gamut that can hold all of the colors the application wants to show and the device could conceivably show, without losing data. Only very high-end Pro monitors for artists and editors can show Rec.2020 usually.

Color Incorrect Displayedit

One thing that can be confusing when looking at the CIE graph, is that since you are looking at it on a monitor, it may be strange that you can see gradident changes all the way to the edge of the recorded human range, even though your monitor can't show gradients that far outside it's gamut. What is happening here is the one of the pitfalls of the way non-color correct display devices/applications function. If that CIE graph was displayed correctly on your monitor, then you would see the color gradients clamp at the limits of your monitor's color limitations, usually around where the sRGB triangle is, with just solid colors outside of that. However since that graph has values ranging from (1, 0, 0) -> (0, 1, 0) -> (0, 0, 1) at it's 3 corners, your monitor is showing those values as what it is able to show for it's max red, max green and max blue. In the future when these pages are displayed in a more color correct way, the values will be clamped on the monitor. Currently if you look at that same graph on a another monitor with a wider gamut, you'd see more saturated colors at the edges.

On a standard monitor you can likely change all kinds of settings such as Hue, Saturation, Brightness, which can further adjust the colors that are shown. This results in the colors you are seeing likely not being the actual colors the author of content intended.

Gamutedit

As discussed before, a gamut defines the triangle on the CIE graph that the color space defines. This defines what (1, 0, 0), (0, 1, 0), (0, 0, 1) mean in terms of true colors visibly by the human eye. When you look at (1, 0, 0) as defined by the sRGB gamut compared to (1, 0, 0) as defined by the Rec.2020 gamut, on a monitor that supports such a wide gamut, you'll actually see that we've all been looking at a shade of orange on our sRGB monitors for years, rather than a deep red.

A gamut is defined by 3 xy coordinates for the 3 corners of the triangle, which represent the red, green and blue corners of the triangle. Additionally a 'white point' is selected for the gamut in the center, which is often known as D65 or D60 for most color spaces, and is also defined using it's xy coordinate in the CIE graph. For example the coordinates for the primaries for Rec.2020 are defined as:

Color space White point Primaries
xW yW xR yR xG yG xB yB
Rec.2020 0.3127 0.3290 0.708 0.292 0.170 0.797 0.131 0.046

Transfer Functionedit

Along with a gamut, a color space also defines a Transfer Function. This defines a curve (often known as Gamma), by which the data is stored in the file and sent to the display. This transfer function can serve many different purposes. With 8-bit data, sRGB content is saved using an sRGB transfer function, which allows the limited 256 steps of values that 8-bit provides, to be better utilized. The transfer functions causes more steps of data to be used in the darker color range, which the human eye is more sensitive to. This helps reduce banding artifacts by giving more steps at the darker levels and less for the brighter ones. With more bits of precision, a transfer function can be less important for saving file data. For example 16-bit float EXR files generally always use a linear transfer function. The transfer function that is conventionally used with a gamut is chosen by standards committees usually, and although they are chosen for good reasons, there is no direct rule that a certain transfer function must be used with a certain gamut.

In fact, whenever you are actually combining colors (such as with compositing them, or using them in lighting calculations), you always want to be doing this with linear values. So a file that was saved with sRGB gamut with sRGB transfer, may be converted in GPU RAM to sRGB gamut and linear transfer before compositing is applied to it's content.

Another important use for transfer functions is when communicating with a monitor. Monitor's will expect the data sent to them to be in the same transfer function that they use to display the content. So a sRGB monitor will want values sent to it using an sRGB transfer. This means after compositing the linear values will be converted back to sRGB transfer before being sent to the sRGB monitor.

Brightnessedit

Another concept important to understand with color is how brightness is defined. How bright should (1, 1, 1) on a monitor? You can certainly turn up your brightness to adjust this, but that may not match what the content author intended. Brightness for color in computers is defined using a term called a Nit. Also defined as Candela per square meter, or cd/m2. Most standard monitors can show between 100 and 300 nits of brightness. A consumer grade HDR monitor may be able to show 500-700 nits, while a Pro one can show 1500-25000 nits. A 100-watt lightbulb is 1,600 nits, while the sun is 1.6 billion nits. The amount of nits that (1, 1, 1) should represent also depends on the viewer setting. A darker room requires less nits to achieve the same perceived brightness. Movie theater projectors for example may only show 75 nits.

How Computers and Monitors Display Coloredit

In the past usually all the content (JPEGs for example) was saved in sRGB color space, and the monitors were expected to be showing sRGB color space. So you could take the values in that JPEG file and send them as-is to the monitor without any adjustment, and they would look correct. Modern image/movie formats though are often in many different color spaces, and monitors can display wider gamuts and have different amounts of maximum nits available. If you were to blindly take (1, 0, 0) from a file format and show it on different monitors with different gamuts, transfer characteristics and max nits, you'd get widely different shades of reds, and brightness levels. Being color spaces aware corrects for this by reading the files using known color spaces, and communicating with the monitor in it's expected color space, by converting between the file's color space the monitors color space.

Both Windows and macOS have settings to control if a monitor is being driven with an SDR or an HDR signal (for HDR capable monitors). This changes mode the monitor is running in, as well as the type of data that is sent down the cable to the monitor.

SDRedit

SDR mode is essentially a 'dumb' mode, that contains no color space information inherently. The monitor may have controls to select which color space it should be running in, and it'll likely have other controls that can make content more saturated/vibrant. Changing these types of controls have no direct correlation to the color space being displayed, and without a calibration tool, likely will cause the colors to not correctly match the desired color space.

Since there is no color space information exchanged between the OS and the monitor, the monitor will just display the value (1, 0, 0) as the brightness and reddest-red it is currently setup to show.

Reference Whiteedit