Contacts

RGB and CMYK color models: an accessible guide. Summary of a lesson in computer science on the topic "Color formation in RGB, CMYK and HSB color rendering systems (Color palettes in RGB, CMYK and HSB color rendering systems)" (grade 9) RGB color rendering system color form

Before we get into the actual description of computer graphics color models, let's discuss a little about the basic concepts of COLOR. And in the video you can see where to find and how to change the color model in Photoshop.

  • How do we perceive color?

Before we get into the CMYK and RGB color palettes, let's understand how we perceive color. We can see objects only because they emit or reflect electromagnetic radiation, that is, LIGHT.

Depending on the wavelength of LIGHT, we see one or another COLOR.

Wavelength is measured in nanometers.

  • What wavelengths correspond to the 7 colors of the rainbow?

LIGHT can be divided into 2 categories:

  1. Emitted light This is the light coming from a source, such as the Sun, a light bulb, or a monitor screen.
  2. Reflected light This is light that has “bounced” off the surface of an object. When we look at an object that is not a light source, we see exactly the reflected color.


The monitor emits light, so this method of producing color is called the additive color system. Paper reflects light, so the color obtained in this way can be described using a system of subtractive colors.

  • RGB color model

This is a subtractive color model that uses three primary colors:

Red

Green

Blue

Its name comes from the first letters of the English names of flowers. By mixing these colors, we can get almost any shade.

RGB is used by monitors, phones, and even cameras, so for computer graphics intended for use on the above devices, you need to use the RGB color mode.

  • How RGB primary colors are mixed


Blue + red = magenta

Green + red = yellow

Green + blue = cyan

When all three color components are mixed, we get white.

  • Primary colors of the RGB palette

Primary colors in RGB are: Red, Blue, Green


  • Additional colors of the RGB palette

Complementary colors are made by mixing two adjacent primary colors.

These include: Magenta, Cyan, Yellow


  • Opposite colors of the RGB palette

When you mix opposite colors, you get white because... the components of the opposite color are the two missing colors (for example, Red + Cyan (blue + green)).

Mixing 2 opposing colors is essentially the same as mixing 3 primary colors. In both cases it will turn out white. This is important to know for anyone who is seriously involved in color correction.


  • CMYK color model

Blue (cyan)

Purple (magenta)

Yellow

Black (Keycolor)

A subtractive color formation scheme used primarily in printing. This system, unlike RGB, is used for printing, so if you bring a design to a printing house, you are usually asked to provide it using the CMYK color mode.

  • How CMYK colors are mixed

Cyan + magenta = blue, magenta + yellow = bright red, yellow + cyan = green.

Cyan, magenta and yellow form a dirty brown color. Black makes any color darker, the absence of dye gives white.


Cyan – Cyan, Magenta – Purple, Yellow – Yellow;


Very often, people who are not directly involved in print design have questions: “What is CMYK?”, “What is Pantone?” and "why can't you use anything other than CMYK?"

In this article we will try to understand a little what color spaces are. CMYK, RGB, LAB, HSB and how to use paints Pantone in layouts.

Color model

CMY(K), RGB, Lab, HSB is a color model. Color model- a term denoting an abstract model for describing the representation of colors as tuples of numbers, usually three or four values, called color components or color coordinates. Together with the method for interpreting this data, the set of colors in a color model defines a color space.

RGB- abbreviation English words Red, Green, Blue- red, green, blue. Additive (Add, English - add) color model, as a rule, used to display images on monitor screens and other electronic devices. As the name implies, it consists of blue, red and green colors, which form all the intermediate ones. Has a large color gamut.

The main thing to understand is that the additive color model assumes that the entire color palette is made up of luminous points. That is, on paper, for example, it is impossible to display color in the RGB color model, since paper absorbs color and does not glow on its own. The final color can be obtained by adding percentages from each of the key colors to the original black (non-luminous) surface.


CMYK - Cyan, Magenta, Yellow, Key color- subtractive (subtract, English - subtract) color formation scheme used in printing for standard process printing. It has a smaller color gamut compared to RGB.

CMYK is called a subtractive model because paper and other printed materials are surfaces that reflect light. It is more convenient to calculate how much light was reflected from a particular surface rather than how much was absorbed. Thus, if we subtract three primary colors - RGB - from white, we get three additional CMY colors. "Subtractive" means "subtractive" - ​​the primary colors are subtracted from white.

Key Color(black) is used in this color model as a replacement for mixing equal parts of the CMY triad colors. The fact is that only in the ideal case, when mixing the colors of the triad, a pure black color is obtained. In practice, it will turn out, rather, dirty brown - as a result of external conditions, the conditions of paint absorption by the material and the imperfection of dyes. In addition, there is an increased risk of under-registration in elements printed in black, as well as waterlogging of the material (paper).



In color space Lab the value of lightness is separated from the value of the chromatic component of color (hue, saturation). Lightness is specified by the L coordinate (varies from 0 to 100, that is, from the darkest to the lightest), the chromatic component is specified by two Cartesian coordinates a and b. The first denotes the color position in the range from green to purple, the second - from blue to yellow.

Unlike RGB or CMYK color spaces, which are essentially a set of hardware data for reproducing color on paper or on a monitor screen (color may depend on the type of printing machine, brand of ink, humidity in production, or the manufacturer of the monitor and its settings) ,Lab uniquely identifies the color. Therefore, Lab has found wide application in software for processing images as an intermediate color space through which data is converted between other color spaces (for example, from an RGB scanner to a CMYK printing process). At the same time, the special properties of Lab made editing in this space powerful tool color correction.

Due to the nature of the color definition in Lab, it is possible to separately influence the brightness, contrast of the image and its color. In many cases, this allows for faster image processing, for example during prepress. Lab provides the ability to selectively influence individual colors in an image, enhancing color contrast, and the capabilities that this color space provides for combating noise in digital photographs are also irreplaceable.


H.S.B.- a model that is, in principle, an analogue of RGB, it is based on its colors, but differs in the coordinate system.

Any color in this model is characterized by Hue, Saturation and Brightness. Tone is the actual color. Saturation is the percentage of white paint added to the color. Brightness - percentage added black paint. So, HSB is a three-channel color model. Any color in HSB is obtained by adding black or white to the main spectrum, i.e. actually gray paint. The HSB model is not a rigorous mathematical model. The description of colors in it does not correspond to the colors perceived by the eye. The fact is that the eye perceives colors as having different brightnesses. For example, spectral green has greater brightness than spectral blue. In HSB, all colors in the main spectrum (hue channel) are considered to have 100% brightness. This is actually not true.

Although the HSB model is declared as hardware-independent, in fact it is based on RGB. In any case, HSB is converted to RGB for display on the monitor and to CMYK for printing, and any conversion is not without losses.


Standard paint set

In the standard case, printing is carried out using cyan, magenta, yellow and black inks, which, in fact, makes up the CMYK palette. Layouts prepared for printing must be in this space, since in the process of preparing photo forms, the raster processor unambiguously interprets any color as a CMYK component. Accordingly, an RGB pattern that looks very beautiful and bright on the screen will look completely different on the final product, but rather gray and pale. The CMYK color gamut is smaller than RGB, so all images prepared for printing require color correction and correct conversion to the CMYK color space!. In particular, if you use Adobe Photoshop for processing raster images, you should use the Convert to Profile command from the Edit menu.

Printing with additional inks

Due to the fact that the CMYK color gamut is not enough to reproduce very bright, “poisonous” colors, in some cases CMYK printing + additional (SPOT) paints. Additional colors are usually called Pantone, although this is not entirely true (the Pantone catalog describes all colors, both included in CMYK and not contained in it) - it is correct to call such colors SPOT (spot), in contrast to spot colors, that is, CMYK.

Physically, this means that instead of four printing units with standard CMYK colors, more are used. If there are only four printing sections, an additional run is organized, during which additional colors are imprinted into the finished product.

There are presses with five printing units, so all colors are printed in one pass, which undoubtedly improves the quality of color registration in the finished product. When printing in 4 CMYK sections and additionally running through a printing machine with spot inks, color matching may suffer. This will be especially noticeable on machines with less than 4 printing sections - you’ve probably seen advertising leaflets more than once, where a yellow frame may protrude slightly beyond the edges of, for example, beautiful bright red letters, which is nothing more than yellow paint from the layout this beautiful red color.

Preparation of layouts for printing

If you are preparing a layout for printing in a printing house and you have not agreed on the possibility of printing with additional (SPOT) inks, prepare the layout in the CMYK color space, no matter how attractive the colors in the Pantone palettes may seem to you. The fact is that to simulate Pantone colors on screen, colors that fall outside the CMYK color space are used. Accordingly, all your SPOT inks will be automatically converted to CMYK and the result will not be at all what you expect.

If your layout (with an agreement to use a triad) still contains non-CMYK paints, be prepared for the layout to be returned to you and asked to be remade.

When compiling the article, materials from citypress72.ru and masters.donntu.edu.ua/ were taken as a basis

RGB and CMY (CMYK) color models

RGB (for display) and CMYK (for print) are the most common color representation systems.

The main model of subtractive color synthesis is the CMYK printing system (blue-green/cyan, magenta, yellow, key/black).

The most common version of additive mixing, which involves the summation of multi-colored streams into a single resulting stream, is the RGB (red, green, blue) model.

If the subtractive scheme is used in printing (with a white zero - the absence of paint on paper), then the additive scheme (with a larger color gamut) is used in televisions, monitors, etc., where the screen looks black when turned off.

Since RGB and CMY complement each other, there is a certain relationship between them. If you display this information in the form of a single color wheel, then the RGB and CMY colors will alternate in it. If you mix two RGB colors, you get a CMY color; if, on the contrary, you mix two CMY colors, then this time you get an RGB color. For example, the CMY model describes red as a mixture of magenta and yellow. And in the RGB model, magenta is described as a mixture of red and blue.

In addition, compared to RGB, CMYK has a smaller color gamut. The laws of physics do not allow printing RGB colors. To print an RGB image, its additive colors must be converted to CMY colors, i.e. convert them to subtractive colors.

RGB color system

RGB Red, Green, Blue – red, green, blue) – additive color model (eng. Additive Primary Model) , describing a method for synthesizing color for color reproduction. The additive model is called because colors are obtained by adding (eng. addition ) to black. The choice of primary colors in RGB is determined by the physiology of color perception by the retina of the human eye.

The RGB model is used to reproduce the spectrum of visible light and represents anything that transmits, filters, or senses light waves (such as a monitor, scanner, or eye) (Figure 7.5). To create different colors, different levels of primary colors (red, green and blue) are added together. Black color is the absence of any light.

Rice. 7.5.

The image in this color model consists of three channels. When mixing primary colors, such as blue ( IN ) and red (/?), we get additional magenta (eng. M – magenta ), when mixing green ( G ) and red ( R ) – additional yellow (eng. Y – yellow ), when mixing green ( G ) and blue ( IN ) additional cyan C – cyan ). When all three color components are mixed, we get white. TVs and monitors use three electron guns (LEDs, light filters) for the red, green and blue channels.

RGB numeric display

Each RGB coordinate is represented as one byte, the values ​​of which are designated by integers from 0 to 255 inclusive, where 0 is the minimum intensity and 255 is the maximum intensity.

COLORREF– standard type for representing colors in operating system Win32. Used to define a color in RGB form. Size – 4 bytes.

Define type variable COLORREF can be done as follows:

COLORREFC = RGB ( r,g,b ),

Where g, g And b – intensity (in the range from 0 to 255) of the red, green and blue components of the detected color, respectively WITH.

Therefore, bright blue can be defined as (0,0,255), red as (255,0,0), bright purple as (255,0,255), black as (0,0,0), and white as (255,255,255).

IN HTML#RrGgBb notation is used, also called hexadecimal: each coordinate is written as two hexadecimal digits, without spaces ( HTML colors see below). For example, #RrGgBb - white color entry - #FFFFFF.

For reference

RGB color space standards. The RGB color model is device dependent. Because monitors different models and manufacturers vary, several color space standards have been proposed for this model.

The most common color space, sRGB, is the standard for monitor displays (the Default profile for computer graphics). The sRGB space used with the RGB color model has a wider color gamut for many color tones (can represent richer colors) than the typical color gamut of CMYK color spaces, so sometimes images that look good in RGB fade out significantly in RGB. CMYK.

Adobe RGB and ProPhoto RGB are also common. ProPhoto RGB color space, also known as ROMM RGB. Reference Output Medium Metric is an RGB color space designed for photo processing and focused on output material. The standard was developed by the company Kodak, it offers particularly wide coverage designed for photographic images.

RGB is the most used color space and it has both strengths and weak sides. On the one hand, the RGB model is optimal for editing high-resolution images. It displays a wide range of values ​​and RGB images can be processed using almost all tools and functions graphic editors .

On the other hand, RGB is device dependent. Whatever the numerical definition of color, the way it is displayed on the screen depends entirely on the display equipment.

  • Graphics editor – a program (or software package) designed for creating and processing graphic files.

Why are different color models needed and why the same color can look different

Providing design services both in the field of web and in the field of printing, we often come across a question from the Client: why do the same corporate colors in the design layout of the website and in the design layout of printed products look different? The answer to this question lies in the differences between color models: digital and printed.

The color of a computer screen varies from black (no color) to white (the maximum brightness of all components of color: red, green and blue). On paper, on the contrary, the absence of color corresponds to white, and the mixture maximum quantity colors - dark brown, which is perceived as black.

Therefore, when preparing for printing, the image must be converted from additive ("folding") flower models RGB into subtractive (“subtractive”) CMYK model. The CMYK model uses the opposite colors of the original colors - the opposite of red is cyan, the opposite of green is magenta, and the opposite of blue is yellow.

Digital RGB color model

What is RGB?

The abbreviation RGB means the names of three colors used to display a color image on the screen: Red (red), Green (green), Blue (blue).

How is RGB color formed?

The color on the monitor screen is formed by combining rays of three primary colors - red, green and blue. If the intensity of each of them reaches 100%, then the color white is obtained. The absence of all three colors produces black.

Thus, any color that we see on the screen can be described by three numbers indicating the brightness of the red, green and blue color components in the digital range from 0 to 255. Graphics programs allow you to combine the desired RGB color from 256 shades of red, 256 shades of green and 256 shades of blue. The total is 256 x 256 x 256 = 16.7 million colors.

Where are RGB images used?

RGB images are used to display on a monitor screen. When creating colors for viewing in browsers, the same RGB color model is used as a basis.

Printing color model CMYK

What is CMYK?

The CMYK system is created and used for typographic printing. The abbreviation CMYK stands for the names of the primary inks used for four-color printing: cyan (Cyan), magenta (Magenta) and yellow (Yellow). The letter K stands for black ink (BlacK), which allows you to achieve a rich black color when printing. The last letter of the word is used, not the first, to avoid confusion between Black and Blue.

How is CMYK color formed?

Each of the numbers that define a color in CMYK represents the percentage of paint of that color that makes up the color combination. For example, to obtain a dark orange color, you would mix 30% cyan paint, 45% magenta paint, 80% yellow paint and 5% black paint. This can be expressed as follows: (30/45/80/5).

Where are CMYK images used?

The scope of application of the CMYK color model is full-color printing. It is this model that most printing devices work with. Due to color model mismatches, there is often a situation where the color you want to print cannot be reproduced using the CMYK model (for example, gold or silver).

In this case, Pantone inks are used (ready-made mixed inks of many colors and shades), they are also called spot inks (since these inks are not mixed during printing, but are opaque).

All files intended for printing must be converted to CMYK. This process is called color separation. RGB covers a larger color range than CMYK, and this must be taken into account when creating images that you later plan to print on a printer or printing house.

When viewing a CMYK image on a monitor screen, the same colors may appear slightly differently than when viewing an RGB image. The CMYK model cannot display the very bright colors of the RGB model; the RGB model, in turn, is not able to convey the dark, dense shades of the CMYK model, since the nature of the color is different.

The color display on your monitor screen changes frequently and depends on lighting conditions, monitor temperature, and the color of surrounding objects. In addition, many colors seen in real life cannot be output when printed, not all colors displayed on screen can be printed, and some print colors are not visible on a monitor screen.

Thus, when preparing a company logo for publication on the website, we use the RGB model. When preparing the same logo for printing in a printing house (for example, on business cards or letterhead), we use a CMYK model, and the colors of this model on the screen may be visually slightly different from those we see in RGB. There is no need to be afraid of this: after all, on paper, the colors of the logo will closely match the colors that we see on the screen.

In the Russian tradition it is sometimes designated as KZS.

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 for representing 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)

Did you like the article? Share it