• Color model. RGB, CMYK, XYZ and other image color schemes

    • 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 the three types of cones contains 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...
    Young's assumption about the retina was wrong, but he concluded correctly: 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 a fairly good understanding of the inner workings of the eye. (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. The base settings were 435.8 nm for blue, 546.1 nm for green and 700 nm for red.


    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:


    Matching functions RGB colors according to CIE 1931

    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 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 nascent theories of what later became linear algebra, for a formal description of 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 this in Charles Poynton's excellent Color FAQ article).

    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 obtain a dimensionless color value that does not depend on its brightness:

    The x and y coordinates are known as chromaticity coordinates, and together with the CIE luminance Y they make up the CIE xyY 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 a device (camera) should be encoded into the signal, i.e. this is the function of the form:

    V used to be 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 the white point has chromaticity

    (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 given system display is called coverage.

    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 of signals, this had the fortunate effect of evenly 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 brightnesses, and various parameters determine viewing conditions and certain 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 bits 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.

    In conclusion

    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. Combined with the absolute brightness values ​​of HDR, this means that optimal HDR viewing requires good conditions: in bright light, the pupil constricts, meaning details in dark areas of the image will be harder to see.

    Tags:

    Add tags

    When printing color computer maps in one way or another, the problem inevitably arises of ensuring accuracy in transmitting the original colors. This problem occurs for a variety of reasons.

    Firstly, scanners And monitors work in an additive color model RGB, based on the rules of color addition, and printing is carried out in a subtractive model CMYK, in which the rules for subtracting colors apply.

    Secondly, the methods of transmitting images on a computer monitor and on paper are different.

    Thirdly, the reproduction process occurs in stages and is carried out on several devices, such as scanner, monitor, phototypesetting machine, which requires their adjustment in order to minimize color distortion throughout the entire technological cycle - process calibration.

    RGB model.

    RGB color model(Fig. 1) ( R-Red- red, G-Green- green, B - Blue- blue) is used to describe colors visible in transmitted or direct light. It is adequate to the color perception of the human eye. Therefore, the construction of images on monitor screens, in scanners, digital cameras and others optical instruments corresponds to the RGB model. In a computer RGB model, each primary color can have 256 brightness levels, which corresponds to 8-bit mode.

    Rice. 1. RGB color model

    Model CMY (CMYK)

    CMY color model(Fig. 2) C-Cyan- blue, M - Magenta- purple, Y-Yellow- yellow, used to describe colors visible in reflected light (for example, the color of paint applied to paper). In theory, the sum of CMY colors at maximum intensity should produce pure black. In real practice, due to the imperfection of the coloring pigments of the paint and the initial instability to blue color during color separation, the sum of cyan, magenta and yellow paints gives a dirty brown color. Therefore, a fourth dye is also used in printing - black - blacK, which produces a rich, uniform black color. It is used for printing text and designing other important details, as well as for adjusting the overall tonal range of images. Color saturation in CMYK model measured as a percentage, so each color has 100 gradations of brightness.

    The main task of the reproduction process is to convert the image from the model RGB into the model CMYK. This transformation is carried out using special software filters, taking into account all future printing settings: process ink system, dot gain coefficient, method of generating black color, ink balance and others. Thus, color separation is a complex process on which the quality of the final image largely depends. But even with optimal conversion from RGB V CMYK inevitably there is a loss of some shades. This is due to the different nature of these color models. It should also be noted that the models RGB And CMYK cannot convey the full spectrum of colors visible to the human eye.

    Rice. 2. CMY color model

    Model HSB.

    Color can be characterized using other visual components. Yes, in the model H.S.B. the basic color space is constructed according to three coordinates: color tone (Hue) ; saturation (Saturation) ; brightness (Brightness) . These parameters can be represented as three coordinates, which can be used to graphically determine the position of a visible color in color space.

    Rice. 3. HSB color model

    On the central vertical axis postponed brightness(Fig. 3), and on horizontal - saturation. The color tone corresponds to the angle at which saturation axis moves away from luminance axis. In the area of ​​the outer radius there are saturated, bright color tones, which, as they approach the center, mix and become less saturated. As you move along the vertical axis, colors of different hue and saturation become either lighter or darker.

    In the center, where all the color tones mix, a neutral gray color is formed.

    This color model fits well with human perception: color tone is the equivalent wavelength of light, saturation- wave intensity, and brightness characterizes the amount of light.

    CIE system.

    Color space can be used to describe the range of colors that are perceived by an observer or reproduced by a device. This range is called scale. This 3D format is also very convenient for comparing two or more colors. Three-dimensional color models and and three-digit color systems, such as RGB, CMY And H.S.B., are called three-coordinate colorimetric data.

    Any measurement system requires a repeatable set of standard scales. For colorimetric measurements, the RGB color model is used as standard cannot be used because it unique- this space depends on specific device. Therefore, there was a need to create universal color system. Such a system is CIE. To obtain a set of standard colorimetric scales, in 1931 International Commission on Illumination- Commission Internationale de l'Eclairage (CIE) - approved several standard color spaces describing the visible spectrum. With these systems, the color spaces of individual observers and devices can be compared against each other based on repeatable standards.

    CIE color systems are similar to others 3D models discussed above, since in order to determine the position of a color in color space, they also use three coordinates. However, unlike the CIE spaces described above - that is, CIE XYZ, CIE L*a*b* and CIE L*u*v* - are device independent, meaning the range of colors that can be defined in these spaces is not limited to pictorial the capabilities of a particular device or the visual experience of a particular observer.

    CIE XYZ.

    The main CIE color space is the CIE XYZ space. It is built on the basis of the visual capabilities of the so-called standard observer, that is, a hypothetical viewer, whose capabilities were carefully studied and recorded during long-term studies of human vision conducted by the CIE commission. This system has three primary colors (red, green and blue) standardized along the wavelength and have fixed coordinates in the xy coordinate plane.

    0.72

    0.28

    0.18

    0.27

    0.72

    0.08

    l, mm

    700.0

    564.1

    435.1

    Based on the data obtained as a result of the research, a xyY color diagram was constructed - a chromatic diagram (Fig. 11).

    All shades visible to the human eye are located inside a closed curve. The primary colors of the RGB model form the vertices of the triangle. This triangle contains the colors displayed on the monitor. The CMYK colors that can be reproduced in printing are enclosed within a polygon. The third coordinate, Y, is perpendicular to any point on the curve and displays the gradations of brightness of a particular color.

    CIE Lab model

    This model is created as an improved CIE model and is also hardware independent. The idea behind the Lab model is that each step in increasing the numerical value of one channel corresponds to the same visual perception as the other steps.

    In the model Lab:

    Magnitude L characterizes lightness (Lightness) (from 0 to 100%);

    Index A defines color range on the color wheel from green to red (- 120 (green) to +120 (red));

    Index b defines range from blue (-120) to yellow (+120).

    At the center of the wheel, the color saturation is 0.

    Lab's color gamut completely includes the color gamuts of all other color models and the human eye. Publishing programs use the Lab model as an intermediate model when converting RGB to CMYK.

    Surely many have heard about such color models as RGB and CMYK, but in fact there are not 2 or 5 such schemes, but more.

    There are different color models and we will talk about them today.

    RGB- R ed G reen B lue, as is known that almost any color can be specified by a combination of three colors - red+green+blue.

    Here is an example of such a model from Wikipedia:

    This model is called additive, since to indicate any of the colors, we use the addition of one of the color channels to black. What is clearly visible in the picture

    The RGB principle is based on the perception of color by the human retina:

    As can be seen from the picture and description, if none of the color channels are specified, the image will be black. If you set all color channels to the maximum, you get white.

    Unlike CMYK, the RGB model covers a much larger number of color tones and has found its wide application in TVs and monitors. Televisions (CRTs) have 3 “guns” that bombard beams of color onto the screen. In LCD screens, liquid crystals also consist of RGB components.

    In computers, the RGB model is specified as numbers from 0 to 255 for each color. If we take html, then the color will be black #000000 , red #FF0000, green #00FF00, blue #0000FF, and white as #FFFFFF. The gray color will be something like #d3d3d3.

    Those who are familiar with printing know that they use a different color model - CMYK. C- Cyan, M- magenta, Y- yellow, K- blac K(there is a lot of controversy about K, many consider it to be derived from k ey plate- key surface, someone from k ontur- contour film, and some from k obalt- dark gray color). In Russian these are the colors Cyan, Purple, Yellow and Black.

    Just like RGB, color is specified by specifying the percentage of one of the color channels.

    Moreover, g+p+f = black, but this is not enough for printing aesthetes. They deal with different equipment and different materials on which the image is printed. For printing, it is important how closely the final image copies the original. After all, when using RGB models, printing on black and white backgrounds (as well as, for example, on cream) will be different. But the CMYK model allows you to level out (minimize) such problems. Moreover, for specific equipment and specific materials, it is recommended to create your own CMYK scheme, which leads to costs for the customizer. Just a piano, not a printer =)

    IN different countries their CMYK standards as well. In America there are some, in Europe there are others, and so on.

    Black color (and in a CMYK printer, for example, laser color, 4 cartridges), which is set by mixing 100% saturated g+p+g, also leads to excessive wetting of the paper (surface), which leads to its deformation from moisture. That's why there is a separate cartridge. Well, a separate black color is cheaper than others (that’s why regular printers have a separate color and a separate black cartridge).

    Since we already talked above about the eye’s perception of the RGB model, for CMYK it is the same:

    If you place 3 (or 4, in the case of CMYK) multi-colored dots very close to each other, the retina will merge them into one dot with a certain color. Here is an example of an enlarged image of a mouse cursor on a WHITE background of a regular LCD monitor:

    Macro shot of a cursor on a white background for a TN+film monitor matrix:

    The same goes for other color models. The eye itself draws the color.

    CIE XYZ - linear three-component color model, based on studies of the human eye by the CIE organization ( Commission Internationale de l'Eclairage ). Scientists have created a model of a standard human eye and, based on it, a color model. Roughly speaking, CIE XYZ is how a three-component image is seen standard man.

    From Wikipedia:

    As is known, human color vision is due to the presence of three types of light-sensitive receptors on the retina of the eye, the maximum spectral sensitivity of which is localized in the region of 420, 534 and 564 nm, which corresponds to blue, green and yellow (although in the literature they usually write “red”) colors. They are basic, all other tones are perceived as a mixture of them in a certain proportion. For example, to obtain the yellow spectral color, it is not at all necessary to reproduce its exact wavelength of 570-590 nm; it is enough to create a radiation spectrum that excites the eye receptors in a similar way. This phenomenon is called.

    The CIE committee conducted many experiments with a huge number of people, asking them to compare different colors, and then, using the aggregate data from these experiments, built the so-called color-matching functions and the universal color space in which it was represented the range of visible colors characteristic of the average person.

    Color matching functions are the values ​​of each of the primary components of light - red, green and blue - that must be present for a person with average vision to perceive all the colors of the visible spectrum. These three primary components were assigned coordinates X, Y and Z.

    YUV- linear three-component color model, which is based on brightness and two color-difference components. We have already considered a similar model in.

    Briefly the model can be described as follows:

    For any pixel (if we are talking about a computer image), a brightness layer is created (in shades of gray), as well as 2 layers necessary to restore the original. The model was used for the transition from b/w TV to color, since old TVs could only use one layer, and new color TVs could use all 3 components. I think a similar technology is used in coloring old Soviet films.

    Model YUV:

    HSV(Hue, Saturation, Value - tone, saturation, value) or H.S.B.(Hue, Saturation, Brightness - hue, saturation, brightness) - a color model, also three-component.

    As can be seen from the figure, these models are presented in three-dimensional format (cylinder and cone). Due to their three-dimensionality, it is not very convenient to use them as a color model inside software and images, but they are very useful as visualization.

    I think similar palettes in graphic editors many of you have seen:

    To select a color from a palette, this presentation format is indeed convenient and is often used in application software.

    RYB- model based on 3 components - Red, Yellow and Blue. Previously it was considered correct, but not all colors can be specified with this model, especially shades of green. Based on the palette of artists who mix paints to obtain the desired color, but artists do not use 3 colors, but more, so the model is no longer used now.

    Lab- an abbreviation for the names of two different (albeit similar) ones. More famous and widespread is CIELAB(more precisely, CIE 1976 L*a*b*), others - Hunter Lab(more precisely, Hunter L, a, b). Thus, Lab is an informal abbreviation that does not uniquely define a color space. Most often, when talking about the Lab space, they mean CIELAB.

    When designing Lab, the goal was to create a color space in which color changes would be more linear from the point of view of human perception (compared to ), that is, so that the same change in color coordinate values ​​in different areas of the color space would produce the same sensation of color change. In this way, the nonlinearity of human color perception would be mathematically corrected. Both color spaces are calculated relative to a specific value. If the white point value is not additionally specified, the Lab values ​​are assumed to be based on a standard D50 illuminator. (c) Wikipedia

    For mere mortals, RGB and CMYK are how we would encode colors for machines, without taking the outcome into account (CMYK takes the outcome into account by calibrating the tool and color model). But LAB provides a display of exactly the color that a person will see. Often used as an intermediate color model when transferring from one model to another.

    NCS (Natural Color System, natural color system) is a color model proposed by the Scandinavian Color Institute (Skandinaviska Färginstitutet AB), Stockholm, Sweden. It is based on a system of opposing colors and has found widespread use in industry to describe the color of products.

    It is based on 6 colors: White, black, blue, yellow, green and red.

    The remaining colors are obtained by specifying darkness, saturation, and two primary colors.

    Like (off the top of my head):

    Orange: 5% darkness, 80% saturation, 50% yellow, 50% red.

    Well, in that spirit.

    Panton color model, PMS (Pantone Matching System) system- a standardized color selection system developed by the American company Pantone Inc in the mid-20th century. Uses digital identification of image colors for printing with both mixed and inks. The reference numbered colors are printed in a special book, the pages of which are folded out like a fan.

    There are other color models, I have selected the most attractive and interesting ones. For our simple needs, RGB, YUV, LAB models are enough; for printing, CMYK and others are also added.

    In general, it was quite interesting to learn how a seemingly simple color is set in completely different models.

    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 vary 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 for us into a large point of a certain color. The brighter the color dot (red, green, blue), the more of that color will be added to the resulting (triple) dot.

    When working with a graphics editor Adobe PhotoShop we can choose a color, relying not only on what we see, but, if necessary, indicate a digital value, thereby sometimes, especially during 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; 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. Adding all the primary colors of maximum brightness gives the color white; 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. The points corresponding to the 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 pie chart (see Fig. 4), which, although it does not provide new information about the model, compared to spatial image, but 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 varying intensities. 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 in whole numbers in the range from 0 to 255. Zero means the absence of this 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 produces only a small part of the 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 range of colors in the RGB model is narrower than many colors in the visible spectrum. To get the part of the spectrum that lies between blue and green flowers, emitters with 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 serious shortcomings 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 reproduced by the device depends on many external factors, which often cannot be taken into account.

    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 produces different colors when warmed up and immediately after turning 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 one more 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.

    The mysterious RGB and CMYK belong to the basic knowledge of graphic design. We'll talk about differences in color rendering to make it clear why the same color in a layout on a computer screen and on paper will look different. You may have already encountered something similar when ordering printing.

    A color model is a way of describing color using quantitative characteristics. A color model is usually a term that refers to an abstract model for describing the representation of colors as three- or four-digit numbers called color components (sometimes color coordinates). A color model is used to describe emitted and reflected colors. Together with the method for interpreting this data, the set of colors in the color model defines the color space.

    What is RGB

    Let's start with the numbers. Displays 16.7 million colors modern monitor computer or a good printing device. Such a large palette is obtained by mixing everything three colors in different proportions - red, blue and green. In graphic editors, each of them is represented by 256 shades (256x256x256=16.7 million).

    RGB- a color model named after the three capital letters of the names of the colors that underlie it: Red, Green, Blue, or red, green, blue. These same colors form all the intermediate ones. The scientific name is the additive model (from the English word add - “add”). Used to display images on monitor screens and other electronic devices. Has a large color gamut.

    The RGB color model assumes that the entire palette is made up of luminous points. This means that it is impossible to depict color in the RGB color model on paper, since the paper absorbs the color rather than glowing. The original color can be obtained by adding percentages from each of the key colors to a non-luminous - or initially black - surface.

    RGB color is obtained by mixing red, blue and green in different proportions: each shade can be described by three numbers indicating the brightness of the three primary colors.

    What does the RGB color model look like?

    Imagine that we directed rays of red, green and blue to one point on a white wall. There will be a white spot in the center, the color intensity at this point reaches 100%. In places where the rays touch, you will see new shades:

    • green+blue - cyan (Cian)
    • blue+red - purple (Magenta)
    • red+green - yellow (Yellow)

    What is CMY(K)

    These three colors are the basis of the CMYK color model - a subtractive model (from the English word subtract - “subtract”), which is based on the subtraction of primary colors from white: cyan subtracts red from white, yellow subtracts blue, and magenta subtracts green. The CMY(K) model is used in printing for standard process printing and, in comparison with the RGB model, has a smaller color gamut. Paper and other printed materials are surfaces that reflect light. Agree, it is much more convenient to count how much light was reflected from a particular surface than to count how much was absorbed.

    If you subtract the three primary colors - RGB - from white, you get three additional CMY colors.

    IN CMYK model There's an extra black color thrown in, and for good reason. In theory, mixing three primary colors should result in black. In reality, there are impurities in the paints, and instead of pure black, the result is an indefinite dirty brown. Moreover, when printing, mixing three colors at once to obtain black greatly moistens the paper; the risk of it becoming waterlogged increases under not always ideal external conditions and due to the characteristics of the dyes themselves. That is why black color was introduced into the model to obtain dark shades and black itself. The letter K in the name of the CMYK model is taken from the word Black, and it denotes the key color - Key Color.

    What is HSB?

    Before summing up, let us emphasize: the RGB and CMYK models do not correspond as well to the concept of color itself as the HSB color model. This is an abbreviation from the English words: Hue, Saturation, Brightness - tone, saturation, brightness. HSB is based on the RGB model, but it has a different coordinate system: each color in this model is created by adding black or white paint to the main spectrum. In this case, tone is the actual color, saturation is the percentage of white paint added to the color, and brightness is the percentage of black paint added.

    The color descriptions in this model do not correspond to the colors perceived by the human eye. This model is used in graphic editors when setting up the color palette. Artists use it to carefully select shades.

    What is the difference between RGB and CMYK?

    So, let's summarize briefly:

    • RGB is the color model by which colors on the screen are based. Based on the addition of colors.
    • CMYK is the color model used to create an image for printing. Based on color subtraction.

    The difference between CMYK and RGB is that an RGB color is essentially just an emitted color (or light), while a CMYK color is a reflected color (paint). The first is formed due to the intensity of the glow, and the second is obtained as a result of the application of paints in printing. Accordingly, any images in electronic form - drawings on a computer monitor, photographs on a phone screen - are based on the RGB model. The CMYK model is used for full color printing. And so that the colors are not lost, the image is transferred from the additive model to the subtractive one before printing. Speaking in the language of designers and layout specialists, the CMYK model is a working tool in offset printing that displays colors on paper.

    CMYK and RGB: practical application

    Typically, four colors are used in printing: cyan, magenta, yellow and black, which makes up the CMYK palette. Layouts for printing must be prepared in the CMYK color model, since in the process of outputting forms, the raster processor unambiguously interprets any color as a CMYK component. It is important to remember that the CMYK color gamut is smaller than RGB, so all images, when preparing a layout for printing, require color correction and correct conversion to the CMYK color space.