Rgb is the designation for the additive color model. What is a color model

This is one of the most common and frequently used models. It is used in devices that emit light, such as monitors, spotlights, filters and other similar devices.

In the RGB model, derived colors are obtained by adding or mixing base, primary colors, called color coordinates. The coordinates are red (Red), green (Green) and blue (Blue). The RGB model got its name from the first letters of the English names of color coordinates.

Each of the above components can range from 0 to 255, forming different colors and thus providing access to all 16 million (the total number of colors represented by this model is 256 * 256 * 256 = 16,777,216.).

This model additive. The word additive (addition) emphasizes that color is obtained by adding points of three basic colors, each with its own brightness. The brightness of each base color can take values ​​from 0 to 255 (256 values), so the model can encode 256 3 or about 16.7 million colors. These triplets of base points (luminous points) are located very close to each other, so that each triple merges into big point a certain color. The brighter the color dot (red, green, blue), the large quantity of this color will be added to the resulting (triple) point.

When working with graphic Adobe editor PhotoShop allows you to choose a color, relying not only on what we see, but if necessary, specify a digital value, thereby sometimes, especially when color correction, controlling the work process.

This color model is considered additive, that is, when Increasing the brightness of individual components will increase the brightness of the resulting color: If you mix all three colors with maximum intensity, the result will be White color; on the contrary, in the absence of all colors the result is black.

Table 1

The meanings of some colors in the RGB model

The model is hardware-dependent, since the values ​​of the basic colors (as well as the white point) are determined by the quality of the phosphor used in the monitor. As a result, the same image looks different on different monitors.

The properties of the RGB model are well described by the so-called color cube (see Fig. 3). This is a fragment of three-dimensional space, the coordinates of which are red, green and blue. Each point inside the cube corresponds to a certain color and is described by three projections - color coordinates: the content of red, green and blue. Addition of all primary colors maximum brightness gives white color; the starting point of the cube means zero contributions of the primary colors and corresponds to the color black.

If color coordinates are mixed in equal proportions, the result is a gray color of varying saturation. Points corresponding gray color, lie on the diagonal of the cube. Mixing red and green produces yellow, red and blue produce magenta, and green and blue produce cyan.

Rice. 3.

Color coordinates: red, green, and blue are sometimes called primary or additive colors. The colors cyan, magenta, and yellow, which are obtained as a result of pairwise mixing of primary colors, are called secondary. Since addition is the basic operation of color synthesis, the RGB model is sometimes called additive (from the Latin additivus, which means added).

The principle of adding colors is often depicted in the form of a flat circular diagram (see Fig. 4), which, although it does not provide new information about the model, compared to a spatial image, is easier to perceive and easier to remember.

Rice. 4.

Many technical devices work on the principle of color addition: monitors, televisions, scanners, overhead projectors, digital cameras etc. If you look through a magnifying glass at the monitor screen, you can see a regular grid, at the nodes of which there are red, green and blue phosphor grain dots. When excited by a beam of electrons they emit basic colors of different intensity. The addition of radiation from closely spaced grains is perceived by the human eye as color at a given point on the screen.

In computer technology, the intensity of primary colors is usually measured by integers in the range from 0 to 255. Zero means the absence of a given color component, the number 255 means its maximum intensity. Since primary colors can be mixed without restriction, it is easy to calculate the total number of colors that an additive model produces. It is equal to 256 * 256 * 256 = 16,777,216, or more than 16.7 million colors. This number seems huge, but in reality the model only generates a small part color spectrum.

Any natural color can be broken down into its red, green and blue components and their intensity measured. But the reverse transition is not always possible. It has been experimentally and theoretically proven that the color range of the RGB model is narrower than many colors visible spectrum. To obtain the part of the spectrum lying between blue and green, emitters with a negative red intensity are required, which, of course, do not exist in nature. The range of colors a model or device can reproduce is called color gamut. One of the serious disadvantages of the additive model, as paradoxical as it may sound, is its narrow color gamut.

It seems that this set of color coordinates uniquely defines a light green color on any device that works on the principle of adding base colors. In reality, things are much more complicated. The color produced by the device depends on many external factors, often impossible to account for.

Display screens are coated with phosphors that differ in chemical and spectral composition. Monitors of the same brand have different wear and lighting conditions. Even one monitor displays various colors in a warm state and immediately after switching on. By calibrating devices and using color management systems, you can try to approximate the color gamuts of different devices. This is discussed in more detail in the next chapter.

It is impossible not to mention another drawback of this color model. From the point of view of a practicing designer or computer artist, it is non-intuitive. Operating in its environment, it can be difficult to answer the simplest questions related to color synthesis. For example, how should the color coordinates be changed to make the current color a little brighter or less saturated? To answer this simple question correctly requires a lot of experience with this color system.

HEX/HTML

HEX color is nothing but a hexadecimal representation of RGB.

Colors are presented in the form of three groups of hexadecimal digits, where each group is responsible for its own color: #112233, where 11 is red, 22 is green, 33 is blue. All values ​​must be between 00 and FF.

Many applications allow a shortened form of hexadecimal color notation. If each of the three groups contains the same characters, for example #112233, then they can be written as #123.

  1. h1 ( color: #ff0000; ) /* red */
  2. h2 ( color: #00ff00; ) /* green */
  3. h3 ( color: #0000ff; ) /* blue */
  4. h4 ( color: #00f; ) /* same blue, shorthand */

RGB

The RGB (Red, Green, Blue) color space consists of all possible colors that can be created by mixing red, green, and blue. This model is popular in photography, television, and computer graphics.

RGB values ​​are specified as an integer from 0 to 255. For example, rgb(0,0,255) is displayed as blue because the blue parameter is set to its highest value (255) and the others are set to 0.

Some applications (particularly web browsers) support percentage recording of RGB values ​​(from 0% to 100%).

  1. h1 ( color: rgb(255, 0, 0); ) /* red */
  2. h2 ( color: rgb(0, 255, 0); ) /* green */
  3. h3 ( color: rgb(0, 0, 255); ) /* blue */
  4. h4 ( color: rgb(0%, 0%, 100%); ) /* same blue, percentage entry */

RGB color values ​​are supported in all major browsers.

RGBA

Recently, modern browsers have learned to work with the RGBA color model - an extension of RGB with support for an alpha channel, which determines the opacity of an object.

The RGBA color value is specified as: rgba(red, green, blue, alpha). The alpha parameter is a number ranging from 0.0 (fully transparent) to 1.0 (fully opaque).

  1. h1 ( color: rgb(0, 0, 255); ) /* blue in regular RGB */
  2. h2 ( color: rgba(0, 0, 255, 1); ) /* the same blue in RGBA, because opacity: 100% */
  3. h3 ( color: rgba(0, 0, 255, 0.5); ) /* opacity: 50% */
  4. h4 ( color: rgba(0, 0, 255, .155); ) /* opacity: 15.5% */
  5. h5 ( color: rgba(0, 0, 255, 0); ) /* completely transparent */

RGBA is supported in IE9+, Firefox 3+, Chrome, Safari, and Opera 10+.

HSL

The HSL color model is a representation of the RGB model in a cylindrical coordinate system. HSL represents colors in a more intuitive and human-readable way than typical RGB. The model is often used in graphics applications, color palettes, and image analysis.

HSL stands for Hue (color/hue), Saturation (saturation), Lightness/Luminance (lightness/lightness/luminosity, not to be confused with brightness).

Hue specifies the position of the color on the color wheel (from 0 to 360). Saturation is the percentage value of the saturation (from 0% to 100%). Lightness is a percentage of lightness (from 0% to 100%).

  1. h1 ( color: hsl(120, 100%, 50%); ) /* green */
  2. h2 ( color: hsl(120, 100%, 75%); ) /* light green */
  3. h3 ( color: hsl(120, 100%, 25%); ) /* dark green */
  4. h4 ( color: hsl(120, 60%, 70%); ) /* pastel green */

HSL is supported in IE9+, Firefox, Chrome, Safari, and Opera 10+.

HSLA

Similar to RGB/RGBA, HSL has an HSLA mode that supports an alpha channel to indicate the opacity of an object.

The HSLA color value is specified as: hsla(hue, saturation, lightness, alpha). The alpha parameter is a number ranging from 0.0 (fully transparent) to 1.0 (fully opaque).

  1. h1 ( color: hsl(120, 100%, 50%); ) /* green in normal HSL */
  2. h2 ( color: hsla(120, 100%, 50%, 1); ) /* the same green in HSLA, because opacity: 100% */
  3. h3 ( color: hsla(120, 100%, 50%, 0.5); ) /* opacity: 50% */
  4. h4 ( color: hsla(120, 100%, 50%, .155); ) /* opacity: 15.5% */
  5. h5 ( color: hsla(120, 100%, 50%, 0); ) /* completely transparent */

CMYK

Color CMY model K often associated with color printing and printing. CMYK (unlike RGB) is a subtractive model, meaning that higher values ​​are associated with darker colors.

Colors are determined by the ratio of cyan (Cyan), magenta (Magenta), yellow (Yellow), with the addition of black (Key/blacK).

Each of the numbers that define a color in CMYK represents the percentage of ink of a given color that makes up the color combination, or more precisely, the size of the screen dot displayed on a phototypesetting machine on film of a given color (or directly on printed form in the case of CTP).

For example, to obtain the PANTONE 7526 color, you would mix 9 parts cyan, 83 parts magenta, 100 parts yellow, and 46 parts black. This can be denoted as follows: (9,83,100,46). Sometimes the following designations are used: C9M83Y100K46, or (9%, 83%, 100%, 46%), or (0.09/0.83/1.0/0.46).

HSB/HSV

HSB (also known as HSV) is similar to HSL, but they are two different color models. They are both based on cylindrical geometry, but HSB/HSV is based on the "hexcone" model, while HSL is based on the "bi-hexcone" model. Artists often prefer to use this model, it is generally accepted that the HSB/HSV device is closer to the natural perception of colors. In particular, the HSB color model is used in Adobe Photoshop.

HSB/HSV stands for Hue (color/hue), Saturation (saturation), Brightness/Value (brightness/value).

Hue specifies the position of the color on the color wheel (from 0 to 360). Saturation is the percentage value of the saturation (from 0% to 100%). Brightness is a percentage of brightness (from 0% to 100%).

XYZ

The XYZ color model (CIE 1931 XYZ) is a purely mathematical space. Unlike RGB, CMYK, and other models, in XYZ the principal components are “imaginary,” meaning you cannot associate X, Y, and Z with any set of colors to mix. XYZ is the master model for almost all other color models used in technical fields.

LAB

The LAB color model (CIELAB, “CIE 1976 L*a*b*”) is calculated from the CIE XYZ space. When developing Lab, the goal was to create a color space in which the color change would be more linear from the point of view of human perception (compared to XYZ), that is, so that the same change in color coordinate values ​​in different areas color space produced the same sensation of color change.

In the Russian tradition it is sometimes designated as GLC.

The choice of primary colors is determined by the physiology of color perception by the retina of the human eye. The RGB color model is widely used in technology.

It is called additive because colors are obtained by adding (eng. addition) to black. In other words, if the color of the screen illuminated by a color spotlight is indicated in RGB as (r 1, g 1, b 1), and the color of the same screen illuminated by another spotlight is (r 2, g 2, b 2), then when illuminated by two spotlights, the color of the screen will be designated as (r 1 + r 2 , g 1 +g 2, b 1 +b 2).

The image in this color model consists of three channels. When mixing primary colors (the primary colors are red, green and blue) - for example, blue (B) and red (R), we get purple (M magenta), when mixing green (G) and red (R) - yellow (Y yellow), when mixing green (G) and blue (B) - cyan (C cyan). When all three color components are mixed, we get white (W).

Definition

The RGB color model was originally developed to describe color on a color monitor, but since monitors vary from model to model and manufacturer, several alternative color spaces have been proposed to correspond to the "average" monitor. These include, for example, sRGB and Adobe RGB.

Variants of this color space differ in different shades of primary colors, different color temperatures, and different gamma correction values.

Presentation of basic RGB colors according to ITU recommendations, in Kelvin space (daylight)

Red: x=0.64 y=0.33 Green: x=0.29 y=0.60 Blue: x=0.15 y=0.06

Matrices for converting colors between RGB and brightness systems when converting an image to black and white):

X = 0.431*R+0.342*G+0.178*B Y = 0.222*R+0.707*G+0.071*B Z = 0.020*R+0.130*G+0.939*B R = 3.063*X-1.393*Y-0.476*Z G = -0.969*X+1.876*Y+0.042*Z B = 0.068*X-0.229*Y+1.069*Z

Numeric representation

RGB color model represented as a cube

For most applications, the coordinate values ​​r, g, and b can be considered to belong to the segment , which represents RGB space as a 1x1x1 cube.

COLORREF

COLORREF - standard type to represent colors in Win32. Used to define colors in RGB form. Size - 4 bytes. When defining any RGB color, the value of a COLORREF type variable can be represented in hexadecimal as follows:

0x00bbggrr

rr, gg, bb - the intensity value of the red, green and blue components of the color, respectively. Their maximum value is 0xFF.

You can define a variable of type COLORREF as follows:

COLORREF C = (b,g,r);

b, g and r are the intensity (in the range from 0 to 255) of the blue, green and red components of the defined color C, respectively. That is, bright red color can be defined as (255,0,0), bright purple - (255 ,0,255), black - (0,0,0), and white - (255,255,255)

  • Translation

I'm going to take a tour of the history of the science of human perception that led to the creation of modern video standards. I will also try to explain commonly used terminology. I'll also briefly discuss why the typical game creation process will, over time, become more and more similar to the process used in the film industry.

Pioneers of color perception research

Today we know that the retina of the human eye contains three different types of photoreceptor cells called cones. Each of three types The cones contain a protein from the opsin family of proteins that absorbs light in different parts of the spectrum:

Light absorption by opsins

Cones correspond to the red, green and blue parts of the spectrum and are often called long (L), medium (M) and short (S) according to the wavelengths to which they are most sensitive.

One of the first scientific works on the interaction of light and the retina was the treatise “Hypothesis Concerning Light and Colors” by Isaac Newton, written between 1670-1675. Newton had a theory that light of different wavelengths caused the retina to resonate at the same frequencies; these vibrations were then transmitted through the optic nerve to the "sensorium".


“Rays of light falling on the bottom of the eye excite vibrations in the retina, which propagate along the fibers of the optic nerves to the brain, creating the sense of vision. Different types rays create vibrations of different strengths, which, according to their strength, excite sensations of different colors ... "

More than a hundred years later, Thomas Young came to the conclusion that since resonance frequency is a system-dependent property, in order to absorb light of all frequencies, there must be an infinite number of different resonance systems in the retina. Jung considered this unlikely, and reasoned that the quantity was limited to one system for red, yellow and blue. These colors have traditionally been used in subtractive paint mixing. In his own words:

Since, for reasons given by Newton, it is possible that the movement of the retina is of an oscillatory rather than a wave nature, the frequency of the oscillations must depend on the structure of its substance. Since it is almost impossible to believe that each sensitive point of the retina contains an infinite number of particles, each of which is capable of vibrating in perfect harmony with any possible wave, it becomes necessary to assume that the number is limited, for example, to the three primary colors: red, yellow and blue...
Jung's assumption about the retina was wrong, but he made correct conclusion: There are a finite number of cell types in the eye.

In 1850, Hermann Helmholtz was the first to obtain experimental proof of Young's theory. Helmholtz asked a subject to match the colors of different patterns of light sources by adjusting the brightness of several monochrome light sources. He came to the conclusion that to compare all samples, three light sources are necessary and sufficient: in the red, green and blue parts of the spectrum.

The Birth of Modern Colorimetry

Fast forward to the early 1930s. By that time, the scientific community had enough good show O internal work eyes. (Although it took another 20 years for George Wald to experimentally confirm the presence and function of rhodopsins in retinal cones. This discovery led him to the Nobel Prize in Medicine in 1967.) Commission Internationale de L'Eclairage (International Commission on Illumination), CIE, set out to create a comprehensive quantitative assessment of human color perception. Quantification was based on experimental data collected by William David Wright and John Guild under parameters similar to those first chosen by Hermann Helmholtz. Basic settings 435.8 nm for blue, 546.1 nm for green and 700 nm for red were selected.
John Guild's experimental setup, three knobs adjusting primary colors

Due to the significant overlap in M ​​and L cone sensitivities, it was not possible to match some wavelengths to the blue-green portion of the spectrum. To “match” these colors, I needed to add a little base red as a reference point:

If we imagine for a moment that all primary colors contribute negatively, then the equation can be rewritten as:

The result of the experiments was a table of RGB triads for each wavelength, which was displayed on the graph as follows:


CIE 1931 RGB color matching functions

Of course, colors with a negative red component cannot be displayed using the CIE primaries.

We can now find the trichrome coefficients for the light spectral intensity distribution S as the following inner product:

It may seem obvious that sensitivity to different wavelengths can be integrated in this way, but in fact it depends on the physical sensitivity of the eye, which is linear with respect to wavelength sensitivity. This was empirically confirmed in 1853 by Hermann Grassmann, and the integrals presented above in their modern formulation are known to us as Grassmann's law.

The term “color space” arose because the primary colors (red, green and blue) can be considered the basis of a vector space. In this space, the different colors perceived by a person are represented by rays emanating from a source. The modern definition of vector space was introduced in 1888 by Giuseppe Peano, but more than 30 years earlier James Clerk Maxwell was already using the nascent theories of what later became linear algebra to formal description trichromatic color system.

CIE decided that, to simplify calculations, it would be more convenient to work with a color space in which the coefficients of the primary colors are always positive. The three new primary colors were expressed in RGB color space coordinates as follows:

This new set of primary colors cannot be realized in the physical world. It's simply a mathematical tool that makes working with color space easier. In addition, to ensure that the coefficients of the primary colors are always positive, the new space is arranged in such a way that the color coefficient Y corresponds to the perceived brightness. This component is known as CIE brightness(you can read more about it in the excellent Color FAQ article by Charles Poynton).

To make it easier to visualize the resulting color space, we'll perform one last transformation. Dividing each component by the sum of the components we get dimensionless quantity color, independent of its brightness:

The x and y coordinates are known as chromaticity coordinates, and together with the Y CIE luminance they make up the xyY CIE color space. If we plot the chromaticity coordinates of all colors with a given brightness on a graph, we will get the following diagram, which is probably familiar to you:


XyY diagram CIE 1931

The last thing you need to know is what is considered white in the color space. In such a display system, white is the x and y coordinates of the color, which are obtained when all the coefficients of the RGB primary colors are equal to each other.

Over the years, several new color spaces have emerged that improve upon the CIE 1931 spaces in various ways. Despite this, the CIE xyY system remains the most popular color space for describing the properties of display devices.

Transfer functions

Before looking at video standards, two more concepts need to be introduced and explained.

Optoelectronic transfer function

The optical-electronic transfer function (OETF) determines how linear light, captured by the device (camera) must be encoded in the signal, i.e. this is the function of the form:

V used to be an analog signal, but now, of course, it is digitally encoded. Typically, game developers rarely encounter OETF. One example in which the feature will be important is the need to combine video footage with computer graphics in a game. In this case, it is necessary to know which OETF the video was recorded with in order to recover the linear light and mix it correctly with the computer image.

Electro-optical transfer function

The electronic-optical transfer function (EOTF) performs the opposite task of OETF, i.e. it determines how the signal will be converted into linear light:

This feature is more important for game developers because it determines how the content they create will be displayed on users' TV screens and monitors.

Relationship between EOTF and OETF

The concepts of EOTF and OETF, although interrelated, serve different purposes. OETF is needed to represent the captured scene from which we can then reconstruct the original linear lighting (this representation is conceptually the HDR (High Dynamic Range) framebuffer of a normal game). What happens during the production stages of a regular film:
  • Capture scene data
  • Inverting OETF to restore linear lighting values
  • Color correction
  • Mastering for various target formats (DCI-P3, Rec. 709, HDR10, Dolby Vision, etc.):
    • Reducing the dynamic range of a material to match the dynamic range of the target format (tone mapping)
    • Convert to target format color space
    • Invert EOTF for the material (when using EOTF in the display device, the image is restored as desired).
A detailed discussion of this technical process will not be included in our article, but I recommend studying a detailed formalized description of the ACES (Academy Color Encoding System) workflow.

Until now, the standard technical process of the game looked like this:

  • Rendering
  • HDR Frame Buffer
  • Tonal correction
  • Invert EOTF for the intended display device (usually sRGB)
  • Color correction
Most game engines use a color grading technique popularized by Naty Hoffman's presentation "Color Enhancement for Videogames" with Siggraph 2010. This technique was practical when only target SDR (Standard Dynamic Range) was used, and it allowed color grading software to be used already installed on most artists' computers, such as Adobe Photoshop.
Standard SDR color grading workflow (image credit: Jonathan Blow)

After the introduction of HDR, most games began to move towards a process similar to that used in film production. Even in the absence of HDR, a cinematic-like process allowed for optimized performance. Doing color grading in HDR means you have the entire dynamic range of the scene. In addition, some effects that were previously unavailable become possible.

Now we are ready to consider different standards, currently used to describe television formats.

Video standards

Rec. 709

Most standards related to video broadcasting are issued by the International Telecommunication Union (ITU), a UN body primarily concerned with information technology.

ITU-R Recommendation BT.709, more commonly referred to as Rec. 709 is a standard that describes the properties of HDTV. The first version of the standard was released in 1990, the latest in June 2015. The standard describes parameters such as aspect ratios, resolutions, and frame rates. Most people are familiar with these specifications, so I will skip them and focus on the color and brightness sections of the standard.

The standard describes in detail chromaticity, limited to the xyY CIE color space. The red, green and blue illuminants of a display standard must be selected such that their individual chromaticity coordinates are as follows:

Their relative intensity must be adjusted so that white dot had color

(This white point is also known as CIE Standard Illuminant D65 and is similar to capturing the chromaticity coordinates of the spectral intensity distribution of normal daylight.)

Color properties can be visually represented as follows:


Coverage Rec. 709

The area of ​​the chromaticity scheme bounded by the triangle created by the primary colors of a given display system is called gamut.

Now we move on to the brightness portion of the standard, and this is where things get a little more complicated. The standard states that "General optical-electronic transfer characteristic in the source" is equal to:

There are two problems here:

  1. There is no specification on what physical brightness corresponds to L=1
  2. Although it is a video broadcast standard, it does not specify EOTF
This happened historically because it was believed that the display device, i.e. consumer TV and there is EOTF. In practice, this was done by adjusting the captured luminance range in the above OETF so that the image would look good on a reference monitor with the following EOTF:

Where L = 1 corresponds to a luminance of approximately 100 cd/m² (the unit of cd/m² is called a "nit" in the industry). This is confirmed by the ITU latest versions standard with the following comment:

In standard production practice, the encoding function of the image sources is adjusted so that the final image has the desired appearance as seen on the reference monitor. The decoding function from Recommendation ITU-R BT.1886 is taken as a reference. The reference viewing environment is specified in ITU-R Recommendation BT.2035.
Rec. 1886 is the result of work to document the characteristics of CRT monitors (the standard was published in 2011), i.e. is a formalization of existing practice.
Elephant Graveyard CRT

The nonlinearity of brightness as a function of applied voltage has led to the way CRT monitors are physically designed. By pure chance, this nonlinearity is (very) approximately the inverted nonlinearity of human brightness perception. When we moved to digital representation signals, this led to the fortunate effect of uniformly distributing the sampling error across the entire brightness range.

Rec. 709 is designed to use 8-bit or 10-bit encoding. Most content uses 8-bit encoding. For it, the standard states that the distribution of the signal brightness range should be distributed in codes 16-235.

HDR10

When it comes to HDR video, there are two main contenders: Dolby Vision and HDR10. In this article I will focus on HDR10 because it is an open standard that has become popular faster. This standard is chosen for Xbox One S and PS4.

We'll start again by looking at the chrominance portion of the color space used in HDR10, as defined in the ITU-R BT.2020 (UHDTV) Recommendation. It contains the following chromaticity coordinates of primary colors:

Once again, D65 is used as the white point. When visualized on an xy Rec. 2020 looks like this:


Coverage Rec. 2020

It is clearly noticeable that the coverage of this color space is significantly greater than that of Rec. 709.

Now we move on to the brightness section of the standard, and this is where things get interesting again. In his 1999 Ph.D. thesis “Contrast sensitivity of the human eye and its effect on image quality”(“Contrast sensitivity of the human eye and its influence on image quality”) Peter Barten presented a slightly scary equation:

(Many of the variables in this equation are themselves complex equations; for example, brightness is hidden inside the equations that calculate E and M).

The equation determines how sensitive the eye is to changes in contrast at different brightness, and various parameters define viewing conditions and some properties of the observer. "Minimum distinguishable difference"(Just Noticeable Difference, JND) is the inverse of Barten's equation, so for EOTF sampling to be free of viewing conditions, the following must be true:

The Society of Motion Picture and Television Engineers (SMPTE) decided that Barten's equation would be a good basis for a new EOTF. The result was what we now call SMPTE ST 2084 or Perceptual Quantizer (PQ).

PQ was created by choosing conservative values ​​for the parameters of the Barten equation, i.e. expected typical consumer viewing conditions. PQ was later defined as the sampling that, for a given luminance range and number of samples, most closely matches Barten's equation with the chosen parameters.

The discretized EOTF values ​​can be found using the following recurrent formula for finding k< 1 . The last sampling value will be the required maximum brightness:

For a maximum brightness of 10,000 nits using 12-bit sampling (which is used in Dolby Vision), the result looks like this:


EOTF PQ

As you can see, sampling does not cover the entire brightness range.

The HDR10 standard also uses EOTF PQ, but with 10-bit sampling. This is not enough to stay below the Barten threshold in the 10,000 nit brightness range, but the standard allows metadata to be embedded into the signal to dynamically adjust peak brightness. Here's what 10-bit PQ sampling looks like for different brightness ranges:


Various EOTF HDR10

But even so, the brightness is slightly above the Barten threshold. However, the situation is not as bad as it might seem from the graph, because:

  1. The curve is logarithmic, so the relative error is actually not that great
  2. Do not forget that the parameters taken to create the Barten threshold were chosen conservatively.
At the time of writing, HDR10 TVs on the market typically have a peak brightness of 1000-1500 nits, and 10-bit is sufficient for them. It's also worth noting that TV manufacturers can decide what to do with brightness levels above the range they can display. Some take a hard pruning approach, others a softer pruning approach.

Here's an example of what 8-bit Rec sampling looks like. 709 with 100 nits peak brightness:


EOTF Rec. 709 (16-235)

As you can see, we're well above Barten's threshold, and importantly, even the most indiscriminate buyers will tune their TVs to well above 100 nits peak brightness (usually 250-400 nits), which will raise the Rec curve. 709 is even higher.

Finally

One of the biggest differences between Rec. 709 and HDR in that the brightness of the latter is indicated in absolute values. In theory, this means that content designed for HDR will look the same on all compatible TVs. At least until their peak brightness.

There is a popular misconception that HDR content will be brighter overall, but this is generally not the case. HDR films will most often be produced so that the average image brightness level is the same as Rec. 709, but so that the brightest parts of the image are brighter and more detailed, which means the midtones and shadows will be darker. In combination with absolute values HDR brightness means that for optimal viewing, HDR requires good conditions: In bright light, the pupil constricts, which means that details in dark areas of the image will be more difficult to see.

Tags:

  • rgb
  • color spaces
  • color spaces
  • video standards
  • hdr
  • hdtv
Add tags

The RGB model (Red - Red, Green - Green, Blue - Blue) describes the emitted colors.

Model RGB(Red - Red, Green - Green, Blue - Blue) describes the emitted colors. The basic components of the model are three colors of rays - red, green, blue. When a person perceives color, it is they that are directly perceived by the eye. The remaining colors are a mixture of the three basic colors in different proportions. Each component can vary from 0 to 255, as discussed in the previous chapter. This method provides access to all 16 million colors. When adding (mixing) two rays of primary colors the result is lighter than the individual components. This type of color is called additive. This model is used in all monitors, projectors and other devices that emit or filter light, including televisions, film projectors and color spotlights. A web designer in his work focuses on an output device such as a monitor, so we will learn to work mainly with images in the RGB model. Let me remind you that she is three-channel(has three components) and 24-bit(the color of one pixel is represented by 24 bits - one byte per channel).


It is convenient to represent the color space of the model in the form color cube. Values ​​are plotted along the coordinate axes color channels. Each of them can take values ​​from zero (no light) to maximum (highest light brightness). The inside of the resulting cube contains all the colors of the model. At the origin, the channel values ​​are zero (black). At the opposite point, the maximum values ​​of the channels are mixed, forming white. On the line connecting these points, mixtures of equal channel values ​​are located, forming gray shades from black to white - a gray scale. Three vertices of the cube give pure original colors, the other three reflect double mixtures of the original colors. In a typical RGB image, each color channel and gray scale has 256 gradations (shades).


An image created in the RGB color model can be saved in any graphic format, supported by Photoshop, except for the GIF format.


The disadvantage of the RGB mode is that not all colors that can be created in it can be printed. You can avoid losing colors by editing your image in CMYK mode.

CMY and CMYK models.

Model CM Y describes reflected colors (paints). They are formed by subtracting part of the spectrum of incident light and are called subtractive. When two colors are mixed, the result is darker than both original colors because each color absorbs part of the spectrum. In other words, the more paint we put in, the more we subtracted from the white, i.e. the lower the resulting brightness will be.


First, let's decipher the name of this model. C= Cyan(turquoise), M= Magenta(magenta), Y= Yellow(yellow ). CMY channels are the result of subtracting the primary colors of the RGB model from white (that is, the color of maximum brightness). Let's write down the "formulas" for obtaining these colors:

  • Turquoise = White - Red
  • Magenta = White - Green
  • Yellow = White - Blue

We can say that the model CMY inverse model RGB. Look at the picture - the base colors of the CMY model are opposite the base colors of the RGB model. According to the RGB model, white color is the sum of three components of maximum brightness, i.e. can be written:
White = Red + Green + Blue.
After some simple mathematical transformations, we get the following representation of the colors of the CMY model:

  • Turquoise = Green + Blue
  • Magenta = Red + Blue
  • Yellow = Red + Green

Compare these formulas with the picture - everything is correct. The yellow color lies between the red and green areas, etc. If this picture doesn't convince you, look at the RGB model picture in the previous chapter.


Development of the model CMY is the model CMYK. It describes the actual color process print on an offset press and color printer. Magenta, cyan and yellow inks (the printing triad) are successively applied to paper in varying proportions, and in this way a significant part of the visible spectrum can be reproduced. In the area of ​​black and dark colors Not colored paint is applied, but black paint. This is the fourth basic component and is introduced to describe the actual printing process. The black component is reduced to a letter K(blacK or, according to another version, Key). CMYK- four-channel color model. Why is black paint added to the model? Real paints contain impurities, and when mixed they will give a dark brown color rather than black. In addition, when printing very dark and black colors it would be necessary a large number of each paint, which leads to waterlogging of the paper and unnecessary consumption of paints.


The color models described are hardware dependent. When displaying the same image on different devices (for example, on two different monitors), you will most likely get different results. That is, the color depends both on the values ​​of the basic components and on the parameters of the devices: the quality and brand of a given printing ink, the properties of the paper used, the properties of the phosphor and other parameters of a particular monitor, printer or printing press. In addition, the existence of different description models for emitted and reflected colors is very inconvenient for computer preparation of color images. The printing process includes systems that operate in both the RGB model (scanner, monitor) and the CMYK model (phototypesetting and printing press). In the process of work, you have to convert color from one model to another. Since these models have different color gamuts, conversion often involves the loss of some shades. Therefore, one of the main challenges when working with color images is to achieve predictable color. For this purpose, a color correction system has been created ( Color Management System, СMS). This is a software system whose purpose is, firstly, to achieve the same colors for all stages of the printing process, from scanner to printing press, and secondly, to ensure stable color reproduction on all output devices (for example, on any monitor). The space of this model is similar to the space of the RGB model in which the origin has been moved. Mixing the maximum values ​​of all three components gives the color black. At complete absence paints ( zero values components) you will get a white color (white paper). Mixing equal values ​​of the three components will produce shades of gray.



The CMYK model is designed specifically for describing printed images. That's why its color gamut is significantly lower than that of RGB (after all, it describes not emitted, but reflected colors, the intensity of which is always less). In addition, as an application model, CMYK is strictly tied to printing parameters (inks, press type, etc.), which vary greatly from case to case. When converting to CMYK, you need to specify a lot of technological characteristics - indicate what specific inks and what paper the image will be printed on, some features of the printing equipment, etc. For different set values The appearance of the image on print and on the screen will be different. Another feature of the model is the theoretically unjustified introduction of an additional black channel. It is designed to correct the shortcomings of modern printing equipment. In dark areas, registration errors are especially visible, the paper may become waterlogged, and the CMY ink mixture does not produce a deep black tone. All these bottlenecks can be eliminated by applying additional black paint. When converting to CMYK, the program replaces process colors with black in dark areas. This replacement is carried out using different algorithms, depending on the composition of the image (black color emphasizes the contours of objects, visually enhancing sharpness), printing features and other reasons. Thus, depending on the translation settings, the appearance of the image changes. Failed translation to CMYK ( color separation) can lead to serious quality losses. Color separation usually involves printing an edition (otherwise why CMYK), and this, in turn, is associated with large financial investments. Therefore, if you have to prepare files for a printing house, you need to study special literature on pre-press preparation.


Let's look at channels in a CMYK image. For the experiment, we need the photo.jpg file. As you can see, the title bar of the window also shows the image model. Now it's RGB. To convert an image to CMYK color mode, select Image team Mode > CMYK. Open the Channels palette. There are five lines there - four lines of color channels and one line of a combined channel. Activating and adjusting the visibility of channels is done in the same way as for RGB images.


Turn off the visibility of all channels except blue. Notice that the image has become much lighter. CMYK channels fold in the same way as paints laid on paper. Almost now you have in front of you a blue form for printing a file. This is how the ink will be distributed on the print. Color saturation is greatest in the blue and blue regions. They are painted in a rich blue color. There is also blue in grayscale areas. This means that in CMYK, shades of gray are formed from a mixture of equal amounts of all components of the model. The area of ​​black and very dark shades is depicted on the print with black ink, so it remains white for now.


Now activate the black channel image without turning off the cyan channel. You can see the shape in which the black paint will be applied. Turn off the visibility of the black channel, add the display of the yellow channel to the cyan one. As you can see, the mixing of colors in the model occurs at a much faster rate. clear principle- when adding blue and yellow components, shades of green are obtained. Green color also received gray areas, since they consist of equal amounts of each of the basic components. Note that the image becomes darker the more channels visible on the screen. Make the magenta channel visible too. The image in medium and light tones has already acquired normal look. There are still white areas in the shadows - all of them will be printed in black, and not in a mixture of three colored inks.