Image discreteness. Analog and discrete image

In the previous chapter we studied linear spatially invariant systems in a continuous two-dimensional domain. In practice, we are dealing with images that have limited dimensions and at the same time are measured in a discrete set of points. Therefore, the methods developed so far need to be adapted, extended and modified so that they can be applied in such an area. Several new points also arise that require careful consideration.

The sampling theorem tells us under what conditions a continuous image can be accurately reconstructed from a discrete set of values. We will also learn what happens when its applicability conditions are not met. All this has direct bearing on the development of visual systems.

Methods that require moving to the frequency domain have become popular in part due to algorithms for fast computation of the discrete Fourier transform. However, care must be taken because these methods assume the presence of a periodic signal. We will discuss how this requirement can be met and what the consequences of violating it are.

7.1. Image Size Limit

In practice, images always have finite dimensions. Consider a rectangular image with width and height H. Now there is no need to take integrals in the Fourier transform over infinite limits:

It is interesting that we do not need to know at all frequencies to restore function. Knowing that at represents a hard constraint. In other words, a function that is nonzero only in a limited region of the image plane contains much less information than a function that does not have this property.

To see this, imagine that the screen plane is covered with copies of a given image. In other words, we extend our image to a function that is periodic in both directions

Here is the largest integer not exceeding x. The Fourier transform of such a multiplied image has the form

Using appropriately selected convergence factors in Ex. 7.1 it is proved that

Hence,

from where we see that it is equal to zero everywhere except for a discrete set of frequencies. Thus, to find it, it is enough for us to know at these points. However, the function is obtained by simply cutting off the section for which . Therefore, in order to restore it, it is enough for us to know only for everyone This is a countable set of numbers.

Note that the transformation of a periodic function turns out to be discrete. The inverse transformation can be represented as a series, since

Another way to see this is to consider a function as a function obtained by truncating some function for which inside the window. In other words, where the window selection function is defined as follows.

Analog and discrete image. Graphic information can be presented in analog or discrete form. An example of an analogue image is a painting whose color changes continuously, and an example of a discrete image is a pattern printed using an inkjet printer, consisting of individual dots of different colors. Analog (oil painting). Discrete.

Slide 11 from the presentation "Encoding and processing of information".

The size of the archive with the presentation is 445 KB.

Computer Science 9th grade

summary of other presentations

“Branching structure algorithms” - IF condition, THEN action. What do we know? Lesson structure. Branching algorithm. Complete the algorithm and fill out the table. The student who scores from 85 to 100 points, inclusive, advances to the second round of the competition. Enter the number of points and determine whether he made it to the second round. Find the largest number between a and b. Write a program in a programming language. A branching algorithm is an algorithm in which, depending on the condition, either one or another sequence of actions is performed.

“Cyclic programs” - Digital. Loop with precondition. Find the amount. Loop with postcondition. Loop with a parameter. Euclid's algorithm. Cyclic programs. Find the sum of natural numbers. The concept of a cycle. An initial fee. Function tabulation. Calculate. Example. Dividers. Computer science. Find the number of numbers. Find. Find the number of three-digit natural numbers. Three-digit numbers. Find the set of function values. Dollar conversion table.

“What is email” - Sender. E-mail address. Email history. The question of the appearance of e-mail. Letter structure. Mail routing. Letter. Email. Copy. Date of. X-mailer. Email. How email works.

“Working with email” - Email address. Mailbox. Email protocol. File sharing network. Address separation. The benefits of email. Mail clients. Inventor of email. Address. Email. Software for working with email. How email works. Teleconference. Mail server. File sharing.

“Processing in Photoshop” - Cool guys. How to distinguish a fake. Raster and vector images. Introduction. Top places. Adobe Photoshop program. Retouching. Competitions on working with Photoshop. Brightness adjustment. My friends. Practical part. Similar programs. Main part. Design. Unusual animals. Montage of multiple images.

Replacing a continuous image with a discrete one can be done in various ways. You can, for example, choose any system of orthogonal functions and, having calculated the coefficients of image representation using this system (using this basis), replace the image with them. The variety of bases makes it possible to form various discrete representations of a continuous image. However, the most commonly used is periodic sampling, in particular, as mentioned above, sampling with a rectangular raster. This discretization method can be considered as one of the options for using an orthogonal basis that uses shifted -functions as its elements. Next, following mainly, we will consider in detail the main features of rectangular sampling.

Let be a continuous image, and let be the corresponding discrete one, obtained from the continuous one by rectangular sampling. This means that the relationship between them is determined by the expression:

where are the vertical and horizontal steps or sampling intervals, respectively. Fig. 1.1 illustrates the location of samples on the plane with rectangular sampling.

The main question that arises when replacing a continuous image with a discrete one is to determine the conditions under which such a replacement is complete, i.e. is not accompanied by a loss of information contained in the continuous signal. There are no losses if, having a discrete signal, it is possible to restore a continuous one. From a mathematical point of view, the question is therefore to reconstruct a continuous signal in two-dimensional spaces between nodes in which its values ​​are known or, in other words, to perform two-dimensional interpolation. This question can be answered by analyzing the spectral properties of continuous and discrete images.

The two-dimensional continuous frequency spectrum of a continuous signal is determined by a two-dimensional direct Fourier transform:

which corresponds to the two-dimensional inverse continuous Fourier transform:

The last relation is true for any values, including at the nodes of a rectangular lattice . Therefore, for the signal values ​​at the nodes, taking into account (1.1), relation (1.3) can be written as:

For brevity, let us denote by a rectangular section in the two-dimensional frequency domain. The calculation of the integral in (1.4) over the entire frequency domain can be replaced by integration over individual sections and summation of the results:

By replacing variables according to the rule, we achieve independence of the integration domain from the numbers and:

It is taken into account here that for any integer values ​​and . This expression is very close in form to the inverse Fourier transform. The only difference is the incorrect form of the exponential factor. To give it the required form, we introduce normalized frequencies and perform a change of variables in accordance with this. As a result we get:

Now expression (1.5) has the form of an inverse Fourier transform, therefore, the function under the integral sign is

(1.6)

is a two-dimensional spectrum of a discrete image. In the plane of non-standardized frequencies, expression (1.6) has the form:

(1.7)

From (1.7) it follows that the two-dimensional spectrum of a discrete image is rectangularly periodic with periods and along the frequency axes and, respectively. The spectrum of a discrete image is formed as a result of the summation of an infinite number of spectra of a continuous image, differing from each other in frequency shifts and . Fig. 1.2 qualitatively shows the relationship between the two-dimensional spectra of continuous (Fig. 1.2.a) and discrete (Fig. 1.2.b) images.

Rice. 1.2. Frequency spectra of continuous and discrete images

The summation result itself significantly depends on the values ​​of these frequency shifts, or, in other words, on the choice of sampling intervals. Let us assume that the spectrum of a continuous image is nonzero in some two-dimensional region in the vicinity of zero frequency, that is, it is described by a two-dimensional finite function. If the sampling intervals are chosen so that for , , then the overlap of individual branches when forming the sum (1.7) will not occur. Consequently, within each rectangular section only one term will differ from zero. In particular, when we have:

at , . (1.8)

Thus, within the frequency domain, the spectra of continuous and discrete images coincide up to a constant factor. In this case, the spectrum of a discrete image in this frequency region contains complete information about the spectrum of a continuous image. We emphasize that this coincidence occurs only under specified conditions, determined by a successful choice of sampling intervals. Note that the fulfillment of these conditions, according to (1.8), is achieved at sufficiently small values ​​of sampling intervals, which must satisfy the requirements:

in which are the boundary frequencies of the two-dimensional spectrum.

Relationship (1.8) determines the method of obtaining a continuous image from a discrete one. To do this, it is enough to perform two-dimensional filtering of a discrete image using a low-pass filter with a frequency response

The spectrum of the image at its output contains non-zero components only in the frequency domain and is equal, according to (1.8), to the spectrum of a continuous image. This means that the output image of an ideal low-pass filter is the same as .

Thus, ideal interpolation reconstruction of a continuous image is performed using a two-dimensional filter with a rectangular frequency response (1.10). It is not difficult to explicitly write down an algorithm for reconstructing a continuous image. The two-dimensional impulse response of the reconstruction filter, which can be easily obtained using the inverse Fourier transform from (1.10), has the form:

.

The filter product can be determined using a two-dimensional convolution of the input image and a given impulse response. Representing the input image as a two-dimensional sequence of -functions

after performing the convolution we find:

The resulting relationship indicates a method for accurate interpolation reconstruction of a continuous image from a known sequence of its two-dimensional samples. According to this expression, for accurate reconstruction, two-dimensional functions of the form should be used as interpolating functions. Relation (1.11) is a two-dimensional version of the Kotelnikov-Nyquist theorem.

Let us emphasize once again that these results are valid if the two-dimensional spectrum of the signal is finite and the sampling intervals are sufficiently small. The fairness of the conclusions drawn is violated if at least one of these conditions is not met. Real images rarely have spectra with pronounced cutoff frequencies. One of the reasons leading to the unlimited spectrum is the limited image size. Because of this, when summing in (1.7), the action of terms from neighboring spectral zones appears in each of the zones. In this case, accurate restoration of a continuous image becomes completely impossible. In particular, the use of a filter with a rectangular frequency response does not lead to accurate reconstruction.

A feature of optimal image restoration in the intervals between samples is the use of all samples of a discrete image, as prescribed by procedure (1.11). This is not always convenient; it is often necessary to reconstruct a signal in a local area, relying on a small number of available discrete values. In these cases, it is advisable to use quasi-optimal reconstruction using various interpolating functions. This kind of problem arises, for example, when solving the problem of linking two images, when, due to the geometric detuning of these images, the available readings of one of them may correspond to some points located in the spaces between the nodes of the other. The solution to this problem is discussed in more detail in subsequent sections of this manual.

Rice. 1.3. The influence of sampling interval on image reconstruction

"Fingerprint"

Rice. Figure 1.3 illustrates the effect of sampling intervals on image restoration. The original image, which is a fingerprint, is shown in Fig. 1.3, a, and one of the sections of its normalized spectrum is in Fig. 1.3, b. This image is discrete, and the value is used as the cutoff frequency. As follows from Fig. 1.3, b, the value of the spectrum at this frequency is negligible, which guarantees high-quality reconstruction. In fact, observed in Fig. 1.3.a the picture is the result of restoring a continuous image, and the role of a restoring filter is performed by a visualization device - a monitor or printer. In this sense, the image in Fig. 1.3.a can be considered continuous.

Rice. 1.3, c, d show the consequences of an incorrect choice of sampling intervals. When obtaining them, the “continuous” image was “sampled” in Fig. 1.3.a by thinning out its counts. Rice. 1.3,c corresponds to an increase in the sampling step for each coordinate by three, and Fig. 1.3, g - four times. This would be acceptable if the values ​​of the cutoff frequencies were lower by the same number of times. In fact, as can be seen from Fig. 1.3, b, there is a violation of requirements (1.9), especially severe when the samples are thinned out four times. Therefore, the images restored using algorithm (1.11) are not only defocused, but also greatly distort the texture of the print.

Rice. 1.4. The influence of the sampling interval on the reconstruction of the “Portrait” image

In Fig. 1.4 shows a similar series of results obtained for an image of the “portrait” type. The consequences of stronger thinning (four times in Fig. 1.4.c and six times in Fig. 1.4.d) are manifested mainly in loss of clarity. Subjectively, the quality loss seems less significant than in Fig. 1.3. This is explained by the significantly smaller spectral width than that of a fingerprint image. The sampling of the original image corresponds to the cutoff frequency. As can be seen from Fig. 1.4.b, this value is much higher than the true value. Therefore, the increase in the sampling interval, illustrated in Fig. 1.3, c, d, although it worsens the picture, still does not lead to such destructive consequences as in the previous example.

As a rule, signals enter the information processing system in a continuous form. For computer processing of continuous signals, it is necessary, first of all, to convert them into digital ones. To do this, sampling and quantization operations are performed.

Image sampling

Sampling– this is the transformation of a continuous signal into a sequence of numbers (samples), that is, the representation of this signal according to some finite-dimensional basis. This representation consists of projecting a signal onto a given basis.

The most convenient and natural way of sampling from the point of view of organizing processing is to represent signals in the form of a sample of their values ​​(samples) at separate, regularly spaced points. This method is called rasterization, and the sequence of nodes at which samples are taken is raster. The interval through which the values ​​of a continuous signal are taken is called sampling step. The reciprocal of the step is called sampling rate,

An essential question that arises during sampling: at what frequency should we take signal samples in order to be able to reconstruct it back from these samples? Obviously, if samples are taken too rarely, they will not contain information about a rapidly changing signal. The rate of change of a signal is characterized by the upper frequency of its spectrum. Thus, the minimum allowable width of the sampling interval is related to the highest frequency of the signal spectrum (inversely proportional to it).

For the case of uniform sampling, the following holds true: Kotelnikov's theorem, published in 1933 in the work “On the capacity of air and wire in telecommunications.” It says: if a continuous signal has a spectrum limited by frequency, then it can be completely and unambiguously reconstructed from its discrete samples taken with a period, i.e. with frequency.

Signal restoration is carried out using the function .

.

Kotelnikov proved that a continuous signal that satisfies the above criteria can be represented as a series: This theorem is also called the sampling theorem. The function is also called sampling function or Kotelnikov

, although an interpolation series of this type was studied by Whitaker in 1915. The sampling function has an infinite extension in time and reaches its greatest value, equal to unity, at the point about which it is symmetrical. Each of these functions can be considered as a response of an ideal low pass filter

(low-pass filter) to the delta pulse arriving at time . Thus, to restore a continuous signal from its discrete samples, they must be passed through an appropriate low-pass filter. It should be noted that such a filter is non-causal and physically unrealizable. The above ratio means the possibility of accurately reconstructing signals with a limited spectrum from the sequence of their samples. Limited Spectrum Signals – these are signals whose Fourier spectrum differs from zero only within a limited portion of the definition area. Optical signals can be classified as one of them, because The Fourier spectrum of images obtained in optical systems is limited due to the limited size of their elements. The frequency is called Nyquist frequency

. This is the limiting frequency above which there should be no spectral components in the input signal.

Image quantization In digital image processing, the continuous dynamic range of brightness values ​​is divided into a number of discrete levels. This procedure is called quantization . Its essence lies in the transformation of a continuous variable into a discrete variable that takes a finite set of values. These values ​​are called quantization levels . In general, the transformation is expressed by a step function (Fig. 1). If the intensity of the image sample belongs to the interval (i.e., when ), then the original sample is replaced by the quantization level, where quantization thresholds

. It is assumed that the dynamic range of brightness values ​​is limited and equal to .

The main task in this case is to determine the values ​​of thresholds and quantization levels. The simplest way to solve this problem is to divide the dynamic range into equal intervals. However, this solution is not the best. If the intensity values ​​of the majority of image counts are grouped, for example, in the “dark” region and the number of levels is limited, then it is advisable to quantize unevenly. In the “dark” region it is necessary to quantize more often, and in the “light” region less often. This will reduce the quantization error.

In digital image processing systems, they strive to reduce the number of quantization levels and thresholds, since the amount of information required to encode an image depends on their number. However, with a relatively small number of levels in the quantized image, false contours may appear. They arise as a result of an abrupt change in the brightness of the quantized image and are especially noticeable in flat areas of its change. False contours significantly degrade the visual quality of the image, since human vision is especially sensitive to contours. When uniformly quantizing typical images, at least 64 levels are required.

Analogue and discrete provision of graphic information A person is able to perceive and store information in the form of images (visual, sound, tactile, gustatory and olfactory). Visual images can be saved in the form of images (drawings, photographs, etc.), and sound images can be recorded on records, magnetic tapes, laser discs, and so on.

Information, including graphic and audio, can be presented in analog or discrete form. With analog representation, a physical quantity takes on an infinite number of values, and its values ​​change continuously. With a discrete representation, a physical quantity takes on a finite set of values, and its value changes abruptly.

Let us give an example of analog and discrete representation of information. The position of a body on an inclined plane and on a staircase is specified by the values ​​of the X and Y coordinates. When a body moves along an inclined plane, its coordinates can take on an infinite number of continuously changing values ​​from a certain range, and when moving along a staircase - only a certain set of values, which change abruptly


An example of an analog representation of graphic information is, for example, a painting, the color of which changes continuously, and a discrete representation is an image printed using an inkjet printer and consisting of individual dots of different colors. An example of analog storage of sound information is a vinyl record (the sound track changes its shape continuously), and a discrete one is an audio CD (the sound track of which contains areas with different reflectivity).

The conversion of graphic and sound information from analogue to discrete form is carried out by sampling, that is, splitting a continuous graphic image and a continuous (analog) sound signal into separate elements. The sampling process involves encoding, that is, assigning each element a specific value in the form of a code.

Sampling is the conversion of continuous images and sound into a set of discrete values ​​in the form of codes.

Sound in computer memory

Basic concepts: audio adapter, sampling rate, register bit depth, sound file.

The physical nature of sound is vibrations in a certain frequency range transmitted by a sound wave through air (or other elastic medium). The process of converting sound waves into binary code in computer memory: sound wave -> microphone -> alternating electric current -> audio adapter -> binary code -> computer memory .

The process of reproducing audio information stored in computer memory:
computer memory -> binary code -> audio adapter -> alternating electric current -> speaker -> sound wave.

Audio adapter(sound card) is a special device connected to a computer, designed to convert electrical vibrations of audio frequency into a numerical binary code when inputting sound and for the reverse conversion (from a numerical code into electrical vibrations) when playing sound.

While recording audio an audio adapter with a certain period measures the amplitude of the electric current and enters it into the register page binary code of the resulting value. Then the resulting code from the register is rewritten into the computer's RAM. The quality of computer sound is determined by the characteristics of the audio adapter: sampling frequency and bit depth.

Sampling frequency– is the number of measurements of the input signal in 1 second. Frequency is measured in Hertz (Hz). One measurement per second corresponds to a frequency of 1 Hz. 1000 measurements in one second -1 kilohertz (kHz). Typical sampling frequencies of audio adapters: 11 kHz, 22 kHz, 44.1 kHz, etc.

Register width– number of bits in the audio adapter register. The bit depth determines the accuracy of the input signal measurement. The larger the bit depth, the smaller the error of each individual conversion of the electrical signal value into a number and back. If the bit depth is 8(16), then when measuring the input signal, 2 8 =256 (2 16 =65536) different values ​​can be obtained. Obviously 16-bit The audio adapter encodes and reproduces sound more accurately than 8-bit.

Sound file– a file that stores audio information in numeric binary form. Typically, information in audio files is compressed.

Examples of solved problems.

Example No. 1.
Determine the size (in bytes) of a digital audio file whose playing time is 10 seconds at a sampling rate of 22.05 kHz and a resolution of 8 bits. The file is not compressed.

Solution.
The formula for calculating the size (in bytes) of a digital audio file (monaural audio): (sampling frequency in Hz)*(recording time in seconds)*(bit resolution)/8.

Thus, the file is calculated as follows: 22050*10*8/8 = 220500 bytes.

Tasks for independent work

No. 1. Determine the amount of memory to store a digital audio file whose playing time is two minutes at a sampling frequency of 44.1 kHz and a resolution of 16 bits.

No. 2. The user has a memory capacity of 2.6 MB. It is necessary to record a digital audio file with a sound duration of 1 minute. What should the sampling frequency and bit depth be?

No. 3. The amount of free memory on the disk is 5.25 MB, the sound bit depth of the board is 16. What is the duration of the sound of a digital audio file recorded with a sampling frequency of 22.05 kHz?

No. 4. One minute of a digital audio file takes up 1.3 MB of disk space, and the sound card's bit depth is 8. At what sampling rate is the sound recorded?

No. 5. Two minutes of recording a digital audio file takes up 5.1 MB of disk space. Sampling frequency – 22050 Hz. What is the bit depth of the audio adapter? No. 6. The amount of free memory on the disk is 0.01 GB, the bit depth of the sound card is 16. What is the duration of the sound of a digital audio file recorded with a sampling frequency of 44100 Hz?

Presentation of graphic information.

Raster representation.

Basic concepts: Computer graphics, pixel, raster, screen resolution, video information, video memory, graphics file, bit depth, video memory page, pixel color code, graphics primitive, graphic coordinate system.

Computer graphics– a branch of computer science, the subject of which is working on a computer with graphic images (drawings, drawings, photographs, video frames, etc.).

Pixel– the smallest image element on the screen (dot on the screen).

Raster– a rectangular grid of pixels on the screen.

Screen resolution– the size of the raster grid, specified as a product M*N, where M is the number of horizontal points, N is the number of vertical points (number of lines).

Video information– information about the image displayed on a computer screen, stored in computer memory.

Video memory– random access memory that stores video information during its playback into an image on the screen.

Graphic file– a file that stores information about a graphic image.

The number of colors reproduced on the display screen (K) and the number of bits allocated in video memory for each pixel (N) are related by the formula: K=2 N

The quantity N is called bit depth.

Page– a video memory section that contains information about one screen image (one “picture” on the screen). Video memory can accommodate multiple pages at the same time.

All the variety of colors on the screen is obtained by mixing three basic colors: red, blue and green. Each pixel on the screen consists of three closely spaced elements that glow in these colors. Color displays that use this principle are called RGB (Red-Green-Blue) monitors.

Code pixel colors contains information about the proportion of each base color.
If all three components have the same intensity (brightness), then from their combinations you can get 8 different colors (2 3). The following table shows the encoding of an 8-color palette using three-bit binary code. In it, the presence of the base color is indicated by one, and the absence by zero.

Binary code


TO Z WITH Color
0 0
0
Black
0 0
1
Blue
0 1 0 Green
0 1 1 Blue
1 0
0
Red
1 0
1
Pink
1 1
0
Brown
1 1
1
White

A sixteen-color palette is obtained using a 4-bit pixel encoding: one intensity bit is added to the three bits of base colors. This bit controls the brightness of all three colors simultaneously. For example, if in an 8-color palette code 100 means red, then in a 16-color palette: 0100 – red, 1100 – bright red; 0110 – brown, 1110 – bright brown (yellow).

A large number of colors are obtained by separately controlling the intensity of the base colors. Moreover, the intensity can have more than two levels if more than one bit is allocated to encode each of the basic colors.

When using a bit depth of 8 bits/pixel, the number of colors is: 2 8 =256. The bits of such a code are distributed as follows: KKKZZSS.

This means that 3 bits are allocated for the red and green components, and 2 bits for the blue components. Consequently, the red and green components each have 2 3 =8 brightness levels, and the blue component has 4 levels.

Vector representation.

With the vector approach, the image is considered as a set of simple elements: straight lines, arcs, circles, ellipses, rectangles, shades, etc., which are called graphic primitives. Graphic information is data that uniquely identifies all the graphic primitives that make up the drawing.

The position and shape of graphic primitives are specified in graphic coordinate system related to the screen. Typically the origin is located in the upper left corner of the screen. The pixel grid coincides with the coordinate grid. The horizontal X axis is directed from left to right; the vertical Y axis is from top to bottom.

A straight line segment is uniquely determined by indicating the coordinates of its ends; circle – coordinates of the center and radius; polyhedron - by the coordinates of its corners, the shaded area - by the boundary line and shading color, etc.

Team

Action

Line to X1,Y1

Draw a line from the current position to position (X1, Y1).

Line X1, Y1, X2, Y2

Draw a line with start coordinates X1, Y1 and end coordinates X2, Y2. The current position is not set.

Circle X, Y, R

Draw a circle: X, Y – coordinates of the center, R – length of the radius in raster grid steps.

Ellipse X1, Y1, X2, Y2

Draw an ellipse bounded by a rectangle; (X1, Y1) are the coordinates of the upper left, and (X2, Y2) are the coordinates of the lower right corner of this rectangle.

Rectangle X1, Y1, X2, Y2

Draw a rectangle; (X1, Y1) are the coordinates of the upper left corner, and (X2, Y2) are the coordinates of the lower right corner of this rectangle.

Drawing color COLOR

Set the current drawing color.

Fill color COLOR

Set the current fill color.

Fill X, Y, BORDER COLOR

Paint an arbitrary closed figure; X, Y – coordinates of any point inside a closed figure, BORDER COLOR – color of the boundary line.

Examples of solved problems.

Example No. 1.
To form the color, 256 shades of red, 256 shades of green and 256 shades of blue are used. How many colors can be displayed on the screen in this case?

Solution:
256*256*256=16777216.

Example No. 2.
On a screen with a resolution of 640*200, only two-color images are displayed. What is the minimum amount of video memory required to store an image?

Solution.
Since the bit depth of a two-color image is 1, and the video memory must at least accommodate one page of the image, the amount of video memory is: 640*200*1=128000 bits =16000 bytes.

Example No. 3.
How much video memory is needed to store four image pages if the bit depth is 24 and the display resolution is 800*600 pixels?

Solution.
To store one page you need

800*600*24 = 11,520,000 bits = 1,440,000 bytes. For 4, respectively, 1,440,000 * 4 = 5,760,000 bytes.

Example No. 4.
The bit depth is 24. How many different shades of gray can be displayed on the screen?
Note: A shade of gray is obtained when the brightness levels of all three components are equal. If all three components have a maximum brightness level, then the color white is obtained; the absence of all three components represents the color black.

Solution.
Since the RGB components are the same to obtain gray shades, the depth is 24/3=8. We get the number of colors 2 8 =256.

Example No. 5.
A 10*10 raster grid is given. Describe the letter “K” with a sequence of vector commands.

Solution:
In vector representation, the letter “K” is three lines. Every line is described by indicating the coordinates of its ends in the form: LINE (X1,Y1,X2,Y2). The image of the letter "K" will be described as follows:

LINE (4,2,4,8)
LINE (5,5,8,2)
LINE (5,5,8,8)

Tasks for independent work.

No. 1. How much video memory is needed to store two image pages, provided that the display resolution is 640*350 pixels and the number of colors used is 16?

No. 2. The amount of video memory is 1 MB. Display resolution – 800*600. What is the maximum number of colors that can be used if the video memory is divided into two pages?

No. 3. The bit depth is 24. Describe several binary representations of light gray and dark gray.

No. 4. On a computer screen you need to get 1024 shades of gray. What should the bit depth be?

No. 5. To depict decimal digits in the postal code standard (as written on envelopes), obtain a vector and raster representation. Choose the raster grid size yourself.

No. 6. Reproduce drawings on paper using vector commands. Resolution 64*48.

A)
Drawing color Red
Fill color Yellow
Circle 16, 10, 2
Shade 16, 10, Red
Set 16, 12
Line to 16, 23
Line to 19, 29
Line to 21, 29
Line 16, 23, 13, 29
Line 13, 29, 11, 29
Line 16, 16, 11, 12
Line 16, 16, 21, 12

B)
Drawing color Red
Fill color Red
Circle 20, 10, 5
Circle 20, 10, 10
Shade 25, 15, Red
Circle 20, 30, 5
Circle 20, 30, 10
Shade 28, 32, Red