Computers Windows Internet

Cool color combination cheat sheet. How to Draw in GIMP Principles of Displaying Color in Computer Graphics

Color in computer graphics.

When working with color, the following concepts are used: color depth (it is also called color resolution) and color model.
To encode the color of an image pixel, a different number of bits can be allocated. This determines how many colors on the screen can be displayed simultaneously. The longer the color binary code, the more colors can be used in the drawing. Color depth is the number of bits used to encode the color of one pixel. To encode a two-color (black and white) image, it is enough to allocate one bit per color representation of each pixel. The allocation of one byte allows you to encode 256 different color shades. Two bytes (16 bits) allow you to define 65536 different colors. This mode is called High Color. If three bytes (24 bits) are used for color encoding, 16.5 million colors can be displayed simultaneously. This mode is called True Color. The color depth determines the size of the file in which the image is saved.

Colors in nature are rarely simple. Most color shades are formed by mixing primary colors. The method of dividing a color shade into its constituent components is called color model. There are many different types of color models, but in computer graphics, as a rule, no more than three are used. These models are known under the names: RGB, CMYK, HSB.

1. RGB color model.

The most easy to understand and obvious model is RGB. Monitors and household TVs work in this model. Any color is considered to consist of three main components: red (Red), green (Green) and blue (Blue). These colors are called primary.

It is also believed that when one component is superimposed on another, the brightness of the overall color increases. The combination of the three components gives a neutral color (gray), which tends to white at high brightness. This corresponds to what we observe on the monitor screen, so this model is always used when preparing an image intended for display on the screen. If the image undergoes computer processing in a graphics editor, then it should also be presented in this model.
The method of obtaining a new hue by summing the brightness of the constituent components is called additive method. It is used everywhere where a color image is viewed in transmitted light ("through"): in monitors, slide projectors, etc. It is easy to guess that the lower the brightness, the darker the shade. Therefore, in the additive model, the central point, which has zero values ​​of the components (0,0,0), is black (the absence of a glow on the monitor screen). The white color corresponds to the maximum values ​​of the components (255, 255, 255). The RGB model is additive, and its components: red (255.0.0), green (0.255.0) and blue (0.0.255) are called primary colors.

2. CMYK color model.

This model is used to prepare not screen, but printed images. They differ in that they are seen not in transmitted, but in reflected light. The more ink is placed on the paper, the more light it absorbs and the less it reflects. The combination of the three primary colors absorbs almost all the incident light, and from the side the image looks almost black. Unlike the RGB model, an increase in the amount of paint does not lead to an increase in visual brightness, but rather to its decrease.

Therefore, for the preparation of printed images, not an additive (summative) model is used, but subtractive (subtractive) model. The color components of this model are not primary colors, but those that result from subtracting primary colors from white:
blue= White - Red = Green + Blue (0.255.255)
purple (lilac) (Magenta)= White - Green = Red + Blue (255.0.255)
yellow= White - Blue = Red + Green (255.255.0)
These three colors are called additional because they complement the primary colors to white.
A significant difficulty in printing is the black color. Theoretically, it can be obtained by combining three basic or additional colors, but in practice the result is unusable. Therefore, a fourth component has been added to the CMYK color model - black. This system is obliged to him by the letter K in the name (blackK).

In printing houses, color images are printed in several steps. By imposing cyan, magenta, yellow and black prints in turn on paper, a full-color illustration is obtained. Therefore, the finished image obtained on a computer is divided into four components of a single-color image before printing. This process is called color separation. Modern graphic editors have the means to perform this operation.
Unlike the RGB model, the center dot is white (no dyes on white paper). A fourth one has been added to the three color coordinates - the intensity of black paint. The black axis looks isolated, but it makes sense: adding color components to black will still result in black. Everyone can check the addition of colors in the CMYK model by picking up blue, chamois and yellow pencils or felt-tip pens. A mixture of blue and yellow on paper gives green, lilac and yellow - red, etc. When all three colors are mixed, an indeterminate dark color is obtained. Therefore, in this model, black was also needed additionally.

3. HSB color model.

Some graphics editors allow you to work with the HSB color model. If the RGB model is the most convenient for a computer, and the CMYK model is for printing houses, then the HSB model is the most convenient for a person. It is simple and intuitive. The HSB model also has three components: color hue (hue), color saturation (Saturation) and color brightness (Brightness). By adjusting these three components, you can get just as many arbitrary colors as with other models. The hue of a color indicates the number of a color in the spectral palette. The saturation of a color characterizes its intensity - the higher it is, the "cleaner" the color. The brightness of the color depends on the addition of black to the given one - the more it is, the less the brightness of the color. The HSB color model is convenient for use in those graphic editors that are focused not on processing ready-made images, but on creating them yourself. There are programs that allow you to imitate various artist's tools (brushes, pens, felt-tip pens, pencils), paint materials (watercolor, gouache, oil, ink, charcoal, pastel) and canvas materials (canvas, cardboard, rice paper, etc.). When creating your own artwork, it is convenient to work in the HSB model, and at the end of the work it can be converted to the RGB or CMYK model, depending on whether it will be used as a screen or print illustration. The color value is chosen as a vector coming out of the center of the circle. The dot in the center corresponds to white (neutral) color, and the dots around the perimeter correspond to pure colors. The direction of the vector determines the hue and is specified in the HSB model in degrees of angle. The length of the vector determines the saturation of the color. The color intensity is set on a separate axis, the zero point of which is black.

The concept of color

Color- an extremely difficult problem, both for physics and for physiology, because it has both psychophysiological and physical nature. The perception of color depends on the physical properties of light, i.e. electromagnetic energy, on its interaction with physical substances, as well as on their interpretation by the human visual system. In other words, the color of an object depends not only on the object itself, but also on the source of light illuminating the object and on the system of human vision. Moreover, some objects reflect light (board, paper), while others let it through (glass, water). If a surface that only reflects blue light is illuminated with red light, it will appear black. Similarly, if a green light source is viewed through a glass that only transmits red light, it will also appear black.

The simplest is achromatic color, i.e. like what we see on a black and white TV screen. In this case, objects that achromatically reflect more than 80% of the light of a white source look white, and less than 3% appear black. The only attribute of such a color is intensity or quantity. Intensity can be mapped to a scalar value by defining black as 0 and white as 1.

If the perceived light contains wavelengths in arbitrary unequal quantities, then it is called chromatic .

In a subjective description of such a color, one usually uses three quantities , such as hue, saturation, and brightness. Color tone allows you to distinguish between colors such as red, green, yellow, etc. (this is the main color characteristic). Saturation characterizes purity, i.e. the degree of weakening (dilution, lightening) of a given color with white light, and allows you to distinguish pink from red, emerald from bright green, etc. In other words, saturation is used to judge how soft or sharp the color seems. Brightness reflects the idea of ​​intensity as a factor independent of hue and saturation (color intensity (power)).



Usually found not clean monochromatic colors, but their mixtures. The three-component theory of light is based on the assumption that there are three types of color-sensitive cones in the central part of the retina. The first perceives green, the second perceives red, and the third perceives blue. The relative sensitivity of the eye is maximum for green and minimum for blue. If all three types of cones are exposed to the same level of energy brightness, then the light appears white. The sensation of white can be obtained by mixing any three colors, as long as none of them is a linear combination of the other two. These colors are called primary. .

The human eye is capable of distinguishing about 350,000 different colors. This number was obtained as a result of numerous experiments. Approximately 128 color tones are clearly distinguishable. If only the saturation changes, then the visual system is no longer able to distinguish so many colors: we can distinguish from 16 (for yellow) to 23 (for red and purple) such colors.

Thus, the following attributes are used to characterize a color:

· Color tone . Can be determined by the dominant wavelength in the emission spectrum. Allows you to distinguish colors.

· Saturation or purity of tone. It is expressed by the proportion of the presence of white. In a perfectly pure color, there is no white admixture. If, for example, white is added to pure red in a certain proportion, then a light, pale red color will be obtained.

· Brightness . It is determined by the energy, the intensity of light radiation. Expresses the amount of perceived light.

These three attributes allow you to describe all colors and shades. The fact that there are exactly three attributes is one of the manifestations of the three-dimensional properties of color.

Most people can distinguish colors, and those involved in computer graphics should clearly feel the difference not only in colors, but also in the subtlest shades. This is very important, since it is the color that carries a large amount of information, which is in no way inferior in importance to either the shape, or the mass, or other parameters that define each body.

Factors affecting the appearance of a particular color:

§ Light source;

§ information about surrounding objects;

§ your eyes;

Properly selected colors can both draw attention to the desired image, and push away from it. This is explained by the fact that depending on what color a person sees, he has various emotions that subconsciously form the first impression of the visible object.

Color in computer graphics is necessary for the following reasons:

§ it carries certain information about objects. For example, trees are green in summer and yellow in autumn. In a black and white photograph, it is almost impossible to determine the time of the year, unless some other additional facts indicate this.

§ color is also necessary in order to distinguish objects.

§ with its help, you can bring some parts of the image to the fore, while others can be taken into the background, that is, focus on the important - compositional - center.

§ Without increasing the size with the help of color, you can convey some details of the image.

§ in two-dimensional graphics, namely the one we see on the monitor, since it does not have a third dimension, it is with the help of color, or rather shades, that the volume is imitated (transmitted).

§ Color is used to attract the attention of the viewer, creating a colorful and interesting image.

Any computer image is characterized, in addition to geometric dimensions and resolution (number of dots per inch), by the maximum number of colors that can be used in it. The maximum number of colors that can be used in a given type of image is called the color depth.

In addition to full-color, there are types of images with different color depths - black and white line, grayscale, indexed color. Some types of images have the same color depth but differ in their color model.

a stream of electromagnetic waves of various lengths and amplitudes. The human eye, being a complex optical system, perceives these waves in the wavelength range from approximately 350 to 780 nm. Light is perceived either directly from a source, for example, from lighting fixtures, or as reflected from the surfaces of objects or refracted when passing through transparent and translucent objects. Color is a characteristic of the perception of electromagnetic waves of different lengths by the eye, since it is the wavelength that determines the visible color for the eye. The amplitude, which determines the energy of the wave (proportional to the square of the amplitude), is responsible for the brightness of the color. Thus, the very concept of color is a feature of the human "vision" of the environment.


Rice. 2.1.

On fig. 2.1 is a schematic representation of the human eye. Photoreceptors located on the surface of the retina act as light receivers. The lens is a kind of lens that forms an image, and the iris plays the role of a diaphragm, regulating the amount of light transmitted into the eye. The sensitive cells of the eye respond differently to waves of different wavelengths. Intensity light is a measure of the energy of light affecting the eye, and brightness is a measure of the perception of this effect by the eye. The integral curve of the spectral sensitivity of the eye is shown in fig. 2.2; it standard curve of the International Commission on Illumination (CIE, or CIE - Comission International de l "Eclairage).

There are two types of photoreceptors: rods and cones. The sticks are highly sensitive and work in low light conditions. They are insensitive to wavelength and therefore do not "distinguish" colors. Cones, on the contrary, have a narrow spectral curve and "distinguish" colors. There is only one type of rods, and cones are divided into three types, each of which is sensitive to a certain range of wavelengths (long, medium or short.) Their sensitivity is also different.

On fig. 2.3 shows the cone sensitivity curves for all three types. It can be seen that the cones that perceive the colors of the green spectrum have the greatest sensitivity, the "red" cones are slightly weaker, and the "blue" cones are much weaker.


Rice. 2.2.


Rice. 2.3.

Thus, if the function characterizes the spectral decomposition of light radiation from a certain source (Fig. 2.4), i.e., the distribution of intensity over wavelengths, then three types of cones will send signals to the brain (red, green, blue), the power of which is determined by the integral ratios

where - sensitivity functions of the corresponding types of cones.


Rice. 2.4.

If the perceived light contains all visible wavelengths in approximately equal amounts, then it is called achromatic and at maximum intensity is perceived as white, and at lower intensities - as shades of gray. It is convenient to consider the intensity of reflected light in the range from 0 to 1, and then the zero value will correspond to black. If light contains wavelengths in unequal proportions, then it is chromatic. An object that reflects light is perceived as being colored if it reflects or transmits light in a narrow range of wavelengths. Similarly, a light source is perceived as colored if it emits waves in a narrow range of wavelengths. When a colored surface is illuminated with a colored light source, quite a variety of color effects can be obtained.

In this section:

    emitted and reflected light in computer graphics;

    formation of color shades on the monitor screen;

    the formation of color shades when printing images.

To describe the color shades that can be reproduced on a computer screen and on a printer, special tools have been developed - color models (or color systems). To successfully apply them in computer graphics, you must:

    understand the features of each color model

    be able to identify a particular color using different color models

    understand how various graphics programs solve the issue of color coding

    understand why the color tones displayed on a monitor are difficult to accurately reproduce in print.

We see objects because they emit or reflect light.

Light - electromagnetic radiation.

Color characterizes the effect of radiation on the human eye. Thus, rays of light, falling on the retina of the eye, produce a sensation of color.

emitted light - it is the light coming out of a source such as the sun, a light bulb, or a monitor screen.

reflected light - it is the light "bounced off" the surface of an object. This is what we see when we look at any object that is not a source of light.

The emitted light, going directly from the source to the eye, retains all the colors from which it is created. But this light can change when reflected from the object (Fig. 1).

Rice. one. Emission, reflection and absorption of light

Like the sun and other light sources, a monitor emits light. The paper on which the image is printed reflects light. Since color can be obtained in the process of radiation and in the reflection gap, there are two opposite methods for describing it: systems of additive and subtractive colors.

Additive Color System

If you look at the screen of a working monitor or TV from a close distance (and even better with a magnifying glass), then it is easy to see many tiny dots of red (Red), green (Green) and blue (Blue) colors. The fact is that thousands of phosphorescent color dots are located on the surface of the screen, which are bombarded by electrons at high speed. Color dots emit light when exposed to an electron beam. Since these dots are very small (about 0.3 mm in diameter), adjacent multi-colored dots merge to form all other colors and shades, for example:

red + green = yellow,

red + blue = magenta,

green + blue = cyan,

red + green + blue = white.

The computer can precisely control the amount of light emitted through each point of the screen. Therefore, by changing the intensity of the glow of colored dots, you can create a wide variety of shades.

Thus, additive (add - attach) color is obtained by combining (summing) the rays of the three primary colors - red, green and blue. If the intensity of each of them reaches 100%, then white is obtained. The absence of all three colors results in black. The additive color system used in computer monitors is commonly referred to as RGB.

In most image creation and editing programs, the user has the ability to generate their own color (in addition to the suggested palettes) using the red, green, and blue components. As a rule, graphics programs allow you to combine the required color from 256 shades of red, 256 shades of green and 256 shades of blue. As you can easily calculate, 256 x 256 x 256 = 16.7 million colors. The appearance of the dialog box for setting an arbitrary color shade in different programs may be different.

Thus, the user can choose a ready-made color from the built-in palette or create his own hue by entering the R, G and B values ​​for the red, green and blue color components in the input fields in the range from 0 to 255.

In CorelDRAW! the RGB color model is additionally represented as a three-dimensional coordinate system, in which the zero point corresponds to black. The coordinate axes correspond to the primary colors, and each of the three coordinates in the range from 0 to 255 reflects the "contribution" of one or another primary color to the resulting hue. Moving pointers ("sliders") along the axes of the coordinate system affects the change in values ​​in the input fields, and vice versa. On the diagonal connecting the origin of coordinates and the point at which all components have a maximum brightness level, there are shades of gray - from black to white (shades of gray are obtained with equal values ​​of the brightness levels of all three components).

Since paper does not emit light, the color model RGB cannot be used to create an image on a printed page.

Subtractive color system

During printing, light is reflected off a sheet of paper. Therefore, for printing graphic images, a color system is used that works with reflected light - the subtractive color system (subtract - subtract).

White is made up of all the colors of the rainbow. If you pass a beam of light through a simple prism, it will decompose into a color spectrum. Red, orange, yellow, green, cyan, indigo and violet make up the visible spectrum of light. White paper reflects all colors when illuminated, while colored paper absorbs some of the colors and reflects the rest. For example, a sheet of red paper illuminated with white light appears red precisely because such paper absorbs all colors except red. The same red paper illuminated with blue will look black because it absorbs blue.

In the system of subtractive colors, the main ones are cyan (Cyan), magenta (Magenta) and yellow (Yellow). Each of them absorbs (subtracts) certain colors from the white light falling on the printed page. Here's how the three primary colors can be used to make black, red, green, and blue:

cyan + magenta + yellow = black,

cyan + magenta = blue,

yellow + magenta = red,

yellow + blue = green.

By mixing primary colors in different proportions on white paper, you can create a wide variety of shades.

White is obtained when all three primary colors are missing. A high percentage of cyan, magenta and yellow forms black. More precisely, the black color should turn out theoretically, but in reality, due to some features of printing inks, a mixture of all three primary colors gives a dirty brown tone, so when printing an image, more black ink is added (Black).

The subtractive color system is abbreviated CMYK(to avoid confusion with Blue, to denote Black character is used TO).

The four-color printing process can be divided into two stages.

1. Creation of four component images of cyan, magenta, yellow and black colors on the basis of the original drawing.

2. Print each of these images one by one on the same sheet of paper.

Separation of a color picture into four components is performed by a special color separation program. If printers were using the CMY system (without adding black ink), converting an image from the RGB system to the CMY system would be very simple: the color values ​​in the CMY system are simply the inverted values ​​of the system RGB. The "color circle" diagram (Fig. 2) shows the relationship between the primary colors of the RGB and CMY models. A mixture of red and green gives yellow, yellow and blue - green, red and blue - purple, etc.

Thus, the color of each triangle in Fig. 2 is defined as the sum of the colors of the triangles adjacent to it. But due to the need to add black ink, the conversion process becomes much more difficult. If the color of a point was determined by a mixture of colors RGB, then in the new system it can be determined by a mixture of values CMY plus include some black. To convert RGB system data to system CMYK The color separation program uses a number of mathematical operations. If a pixel in the RGB system had a pure red color (100% R, 0% G, 0% B), then in the system CMYK it should have equal magenta and yellow values ​​(0% C, 100% M, 100% Y, 0% K).

In the table below, for example, a description of several colors using models is presented. RGB and CMYK(range of change of components of color - from 0 to 255).

Table 1

It is important that instead of solid color areas, the color separation program creates screens from individual dots, and these dot screens are slightly rotated relative to each other so that dots of different colors do not overlap one another, but are located side by side.

Small dots of different colors, close to each other, seem to merge together. This is how our eyes perceive the resulting color.

Thus, the RGB system works with emitted light, and CMYK- with reflected. If it is necessary to print the image received on the monitor on the printer, a special program converts one color system to another. But in systems RGB and CMYK the nature of obtaining flowers is different. Therefore, the color that we see on the monitor is quite difficult to accurately replicate when printed. Normally, a color appears slightly brighter on screen than the same color printed.

The whole set of colors that can be created in a color model is called color range. RGB range over range CMYK. This means that the colors created on the screen may not always be reproduced in print. Therefore, some graphics programs provide range warning signs. They appear if the color created in the RGB model is out of range. CMYK.

There are programs (for example, CorelDraw! andAdobePho­ toShop), which allow you to create drawings on the screen not only in the RGB system, but also in colors CMYK. To create an arbitrary color in the system CMYK you must specify the percentage of each primary color in the same way as it is done when working with the RGB model. Then, looking at the screen, the user will be able to see how the drawing will look when printed.

Hue - Saturation - Brightness system

Color systems RGB and CMYK are based on limitations imposed by the hardware (computer monitors and printing inks). A more intuitive way to describe a color is to represent it as a tone. (Hue), saturation (Saturation) and brightness (brightness). The abbreviation for this color system is HSB. Tone - specific shade of color: red, yellow, green, magenta, etc. Saturated ness characterizes the "purity" of the color: by reducing the saturation, we "dilute" it with white. Brightness the same depends on the amount of black paint added to a given color: the less black, the greater the brightness of the color. To be displayed on a computer monitor, the system HSB converted to RGB, and for printing on a printer - to the system CMYK. You can create an arbitrary color by entering values ​​for hue, saturation, and brightness in the H, S, and B input fields from a range of 0 to 255.

In addition, the user can select a color tone by clicking on the corresponding point in the color field.

The concept of color

Color- an extremely difficult problem, both for physics and for physiology, because it has both psychophysiological and physical nature. The perception of color depends on the physical properties of light, i.e. electromagnetic energy, on its interaction with physical substances, as well as on their interpretation by the human visual system. In other words, the color of an object depends not only on the object itself, but also on the source of light illuminating the object and on the system of human vision. Moreover, some objects reflect light (board, paper), while others let it through (glass, water). If a surface that only reflects blue light is illuminated with red light, it will appear black. Similarly, if a green light source is viewed through a glass that only transmits red light, it will also appear black.

The simplest is achromatic color, i.e. like what we see on a black and white TV screen. In this case, objects that achromatically reflect more than 80% of the light of a white source look white, and less than 3% appear black. The only attribute of such a color is intensity or quantity. Intensity can be mapped to a scalar value by defining black as 0 and white as 1.

If the perceived light contains wavelengths in arbitrary unequal quantities, then it is called chromatic .

In a subjective description of such a color, one usually uses three quantities , such as hue, saturation, and brightness. Color tone allows you to distinguish between colors such as red, green, yellow, etc. (this is the main color characteristic). Saturation characterizes purity, i.e. the degree of weakening (dilution, lightening) of a given color with white light, and allows you to distinguish pink from red, emerald from bright green, etc. In other words, saturation is used to judge how soft or sharp the color seems. Brightness reflects the idea of ​​intensity as a factor independent of hue and saturation (color intensity (power)).



Usually found not clean monochromatic colors, but their mixtures. The three-component theory of light is based on the assumption that there are three types of color-sensitive cones in the central part of the retina. The first perceives green, the second perceives red, and the third perceives blue. The relative sensitivity of the eye is maximum for green and minimum for blue. If all three types of cones are exposed to the same level of energy brightness, then the light appears white. The sensation of white can be obtained by mixing any three colors, as long as none of them is a linear combination of the other two. These colors are called primary. .

The human eye is capable of distinguishing about 350,000 different colors. This number was obtained as a result of numerous experiments. Approximately 128 color tones are clearly distinguishable. If only the saturation changes, then the visual system is no longer able to distinguish so many colors: we can distinguish from 16 (for yellow) to 23 (for red and purple) such colors.

Thus, the following attributes are used to characterize a color:

· Color tone . Can be determined by the dominant wavelength in the emission spectrum. Allows you to distinguish colors.

· Saturation or purity of tone. It is expressed by the proportion of the presence of white. In a perfectly pure color, there is no white admixture. If, for example, white is added to pure red in a certain proportion, then a light, pale red color will be obtained.

· Brightness . It is determined by the energy, the intensity of light radiation. Expresses the amount of perceived light.

These three attributes allow you to describe all colors and shades. The fact that there are exactly three attributes is one of the manifestations of the three-dimensional properties of color.

Most people can distinguish colors, and those involved in computer graphics should clearly feel the difference not only in colors, but also in the subtlest shades. This is very important, since it is the color that carries a large amount of information, which is in no way inferior in importance to either the shape, or the mass, or other parameters that define each body.

Factors affecting the appearance of a particular color:

§ Light source;

§ information about surrounding objects;

§ your eyes;

Properly selected colors can both draw attention to the desired image, and push away from it. This is explained by the fact that depending on what color a person sees, he has various emotions that subconsciously form the first impression of the visible object.

Color in computer graphics is necessary for the following reasons:

§ it carries certain information about objects. For example, trees are green in summer and yellow in autumn. In a black and white photograph, it is almost impossible to determine the time of the year, unless some other additional facts indicate this.

§ color is also necessary in order to distinguish objects.

§ with its help, you can bring some parts of the image to the fore, while others can be taken into the background, that is, focus on the important - compositional - center.

§ Without increasing the size with the help of color, you can convey some details of the image.

§ in two-dimensional graphics, namely the one we see on the monitor, since it does not have a third dimension, it is with the help of color, or rather shades, that the volume is imitated (transmitted).

§ Color is used to attract the attention of the viewer, creating a colorful and interesting image.

Any computer image is characterized, in addition to geometric dimensions and resolution (number of dots per inch), by the maximum number of colors that can be used in it. The maximum number of colors that can be used in a given type of image is called the color depth.

In addition to full-color, there are types of images with different color depths - black and white line, grayscale, indexed color. Some types of images have the same color depth but differ in their color model.