Lesson plan:
Examples of information encoding:
- broadcasting written messages using Russian letters (ABVGD...EYYA);
- writing numbers in digits (0123456789);
- use of sign language in communication between deaf and mute people
In other words, the transition of a message from one form to another, according to certain rules, expresses the essence of information encoding.
Information is encoded for the following purposes:
- simplifying the collection of initial data;
- reducing the amount of memory occupied by information messages;
- convenience of storing materials;
- efficient processing and exchange of information;
- concealment of necessary information.
The history of information coding goes back hundreds of centuries. People have been using cryptograms (encrypted messages) for a long time.
In the 19th century, with the invention of the telegraph by S. Morse, a fundamentally new method of encryption was invented. A telegraph message was transmitted over wires using a sequence of short and long signals (dot and dash).
Following him, J. Baudot created a method of binary coding of information, fundamental in the history of modern computer science, which consists of using only two different electrical signals. Encoding information in a computer also involves the use of two numbers.
Developed in 1948 K. Shannon's “Information and Coding Theory” has become fundamental to modern data coding.
Information coding in computer science is one of the basic topics. Understanding why the procedure for encoding transmitted information is needed and how it is carried out will help in studying the principles of computer operation.
Encoding methods
Let's analyze various types of information and the features of its coding.
Based on the principle of presentation, all information information can be classified into the following groups:
- graphic;
- audio information (sound);
- symbolic (text);
- numeric;
- video information.
Methods of encoding information are determined by the goals set, as well as the available capabilities, methods of its further processing and storage. Identical messages can be displayed in the form of pictures and symbols (graphic method), numbers (numeric method) or symbols (symbolic method).
Encoding methods.
Accordingly, information is classified according to the encoding method:
- symbolic messages include traffic signs, traffic signals, etc.;
- text data – these are books, musical notations, various documents;
- all kinds of images (photos, diagrams, drawings) represent the whole variety of graphic information.
To decipher the message displayed in the chosen information encoding system, it is necessary to carry out decoding - the process of restoring it to the original material. To successfully decrypt, you need to know the type of code and encryption methods.
The most common types of information encodings are the following:
- text conversion;
- graphic encoding;
- coding of numeric data;
- converting sound into a binary sequence of numbers;
- video encoding
There are such methods of encoding information as:
- replacement (substitution) method – the characters of the original message are replaced with the corresponding characters of the selected code algorithm;
- permutation method - characters of the original text are swapped according to a certain pattern;
- gamma method - a random sequence of other characters is added to the original symbols.
Tasks on encoding graphic information encountered on the Unified State Exam in computer science
Let's consider the solution to the problem from the DEMO version of the Unified State Exam in computer science $2020$. This is a task for $#9$.
The task. To store an arbitrary bitmap image of $128 • 320$ pixels, $40$ KB of memory is allocated, excluding the size of the file header. The same number of bits are used to encode the color of each pixel, and the pixel codes are written to the file one after the other without gaps. Question . What is the maximum number of colors that can be used in an image? |
Solution . As I said above, almost all tasks from the Unified State Exam in computer science are focused on encoding raster graphics. It is known that the more memory is allocated for encoding the $1$-th pixel, the more colors it can be painted.
Therefore, our task is to determine how much memory is allocated for encoding the $1$th pixel of a given image.
From the problem statement we know the total number of pixels that make up the original image: $128 • $320. Also, from the problem statement, we know the total memory size allocated for the original image: $40$ KB.
Therefore, let's find how many bits of memory are allocated for one specific pixel, that is, let's find the color depth $I$. It is very desirable to get the result in bits, and not bytes, kilobytes, etc.
$<Memory\ occupied by\ $1$-bit\>\ =\ \frac{<Total\ size\ memory>}{<Total\ number\ pixels>}$, [bit]
To simplify the subsequent mathematical calculations:
- Let us factorize all given natural numbers into prime factors;
- Let's convert the units of information from [KB] to [bit].
$128 = 2 · 2 · 2 · 2 · 2 · 2 · 2 = 2^7$
$320 = 2 · 2 · 2 · 2 · 2 · 2 · 5 = 2^6 · 5$
$40\ [Kbyte] = 2 · 2 · 2 · 5\ [Kbyte] = 2^3 · 5 · 2^{13}\ [bit] = 2^{16} · 5\ [bit]$
We substitute the decomposed and converted values into the formula:
$I = \frac{2^{16}\ ·\ 5 [bits]}{2^7\ ·\ 2^6\ ·\ 5} = \frac{2^{16}\ ·\ 5 [bits] }{2^{13}\ ·\ 5} = 2^3 = 8$, [bit]
Conclusion : exactly $8$ bits or $1$ bytes of memory are allocated for encoding each pixel of a given image.
Go ahead! The condition states that “The same number of bits are used to encode the color of each pixel,” that is, a uniform code is used to encode graphic information. Therefore, we will use Hartley's formula to find the number of acceptable different colors.
$N = 2^I = 2^8 = $256, various colors. But this is already the answer!
We found exactly the maximum number of different colors, since we used the entire possible color depth $I = 8$. As an answer, you need to write down only the resulting natural number $256$ without any units of measurement.
Answer: $256$.
Coding graphic information for your consideration . To consolidate the material you have covered, try to solve these examples yourself and compare the answers you receive with mine.
Example $№1$ The automatic camera produces raster images of $200 × 256$ pixels. The same number of bits are used to encode the color of each pixel, and the pixel codes are written to the file one after the other without gaps. The size of an image file cannot exceed $65$ KB, excluding the size of the file header. What is the maximum number of colors that can be used in a palette? Go to text solution |
Example $№2$ What is the minimum amount of memory (in KB) that must be reserved so that any bitmap image of size $64 × 64$ pixels can be stored, given that the image can contain $256$ of different colors? Go to text solution |
Example $№3$ After converting a raster $256$-color graphics file to a $4$-color format, its size was reduced by $18$ [KB]. What was the size of the original file? Get the answer in [KB]. Go to text solution |
Binary code
The most widely used method of encoding information is binary encoding. Binary data encoding is used in all modern technologies.
Binary code is a sequence of zeros and ones. This is a universal way to display any information information (text messages, pictures, sound and video materials). Information encoded in binary code is very convenient to store, process and transfer from one electronic device to another, which is the advantage of using binary encoding of information.
Binary coding of information is used for various data:
- Binary coding of text information consists of assigning alphabetic, digital and other symbols to a specific code. It is recorded in computer memory as a string of zeros and ones. The way the alphabet is encoded into binary using the ASCII standard is a clear example;
- the type of graphics used affects how the binary encoding of graphic information is performed;
- binary coding of audio information occurs after sampling the sound wave and assigning each component a corresponding binary chain of numbers;
- Binary coding of video materials combines the principles of working with sound and raster images.
Computer Science Test Graphic Information Processing Grade 7
Computer science test Processing of graphic information for 7th grade students of the Federal State Educational Standard. The test contains 16 tasks and is designed to test knowledge on the relevant topic.
1. Graphics input devices include:
a) printer b) monitor c) mouse d) video card
2. Graphics output devices include:
a) scanner b) monitor c) joystick d) graphic editor
3. The smallest image element on a graphics screen is:
a) cursor b) character c) pixel d) line
4. The spatial resolution of a monitor is defined as:
a) the number of lines on the screen b) the number of pixels in a line c) the size of video memory d) the product of the number of image lines by the number of pixels in a line
5. The color of a pixel on a monitor screen is formed from the following basic colors:
a) red, blue, green b) red, yellow, blue c) yellow, cyan, purple d) red, orange, yellow, green, cyan, indigo, violet
6. Color depth is the quantity:
a) colors in the palette b) bits that are used to encode the color of one pixel c) base colors d) image pixels
7. Video memory is intended for:
a) storing information about the color of each pixel of the monitor screen b) storing information about the number of pixels on the monitor screen c) permanently storing graphic information d) displaying graphic information on the monitor screen
8. A graphical object is not:
a) drawing b) text of letter c) diagram d) drawing
9. Graphic editor is:
a) a device for creating and editing drawings b) a program for creating and editing text images c) a device for printing drawings on paper d) a program for creating and editing drawings
10. Advantages of a raster image:
a) sharp and clear contours b) small file size c) color accuracy d) ability to scale without loss of quality
11. Vector images are constructed from:
a) individual pixels b) graphic primitives c) fragments of finished images d) segments and rectangles
12. A raster graphics editor is NOT:
a) Gimp b) Paint c) Adobe Photoshop d) CorelDraw
13. An uncompressed 64 x 512 pixel bitmap image takes up 32 KB of memory. What is the maximum possible number of colors in the image palette?
a) 8 b) 16 c) 24 d) 256
14. A bitmap image was saved in the file p1.bmp as a 24-bit image. How many times will the information volume of the p2.bmp file be smaller if the same image is saved in it as a 16-color drawing?
a) 1.5 b) 6 c) 8 d) file size will not change
15. A color image measuring 25 x 30 cm is scanned. The scanner resolution is 300 x 300 dpi, color depth is 3 bytes. What information volume will the resulting graphic file have?
a) approximately 30 MB b) approximately 30 KB c) approximately 200 MB d) approximately 10 MB
16. Calculate the amount of video memory required to store a graphic image that occupies the entire monitor screen with a resolution of 1280 x 1024 and a palette of 65,536 colors.
a) 2560 bits b) 2.5 KB c) 2.5 MB d) 256 MB
Answers to the computer science test Processing graphic information: 1-c, 2-b, 3-c, 4-d, 5-a, 6-b, 7-a, 8-b, 9-d, 10-c, 11 -b, 12-d, 13-d, 14-b, 15-a, 16-c.
PDF version Test Processing of graphic information (83 Kb, pdf)
Graphics processing
Coding of text, audio and graphic information is carried out for the purpose of its high-quality exchange, editing and storage. The encoding of information messages of various types has its own distinctive features, but, in general, it comes down to converting them into binary form.
Drawings, illustrations in books, diagrams, blueprints, etc. – examples of graphic messages. Modern people are increasingly using computer technology to work with graphic data.
The essence of encoding graphic and audio information is to convert it from analog to digital.
Coding of graphic information is the procedure of assigning a specific code value to each component of the image.
Methods for encoding graphic information are subject to image representation methods (raster or vector):
- The principle of encoding graphic information using the raster method is to assign a binary code to the pixels (dots) that form the image. The code contains information about the color shades of each point. An example is photographs taken with a digital camera.
- Vector encoding is accomplished through the use of mathematical functions. The components of vector images (points, straight lines and other geometric shapes) are assigned a binary sequence that defines various parameters. Such graphics are often used in printing.
Many people will be wondering: “What is the essence of encoding graphic information presented in the form of 3D images?” The fact is that working with three-dimensional data combines raster and vector encoding methods.
Coding and processing graphic information of various formats has both its advantages and disadvantages.
Lesson 18§15. Encoding graphic information
Home | Computer Science and Information and Communication Technologies | Lesson planning and lesson materials | 10th grade | Planning lessons for the school year (FSES) | Encoding graphic information
Lesson content:
15.1. General approaches to coding graphic information. 15.2. Vector and raster graphics 15.3. Color coding 15.4. RGB 15.5 color model. HSB color model. 15.6. The CMYK color model is THE MOST IMPORTANT. Questions and assignments Materials for the lesson
15.1. General approaches to coding graphic information 15.2. Vector and raster graphics |
15.3. Color coding |
Processing and storing graphic information requires significant computing resources, which only appeared in fourth-generation computers.
15.1. General approaches to encoding graphic information
Space is continuous, which means that any region of it contains an infinite number of points. To save an image absolutely accurately, you need to remember information about each point. In other words, a computer representation of some image (for example, V. I. Surikov’s painting “Boyarina Morozova”) must contain information about an infinite number of points, which would require an infinite amount of memory to store. But the memory of any computer is finite. In order for a computer to store and process images, it is necessary to limit itself to selecting a finite number of spatial objects (areas or points), information about which will be stored. Information about all other points in space will be lost.
Spatial discretization is a method of selecting a finite number of spatial elements, information about which will be stored in computer memory.
Color and brightness are characteristics inherent in each element (point, area) of the image. They can be measured, that is, expressed in numbers. Both color and brightness are continuous quantities, the measurement results of which should be expressed in real numbers. But you know that real numbers cannot be represented exactly in a computer.
Quantization is a procedure for converting a continuous range of all possible input values of a measured quantity into a discrete set of output values.
When quantizing, the range of possible values of the measured quantity is divided into several subranges. When measuring, the subrange in which the value falls is determined, and only the subrange number is stored in the computer.
Sampling and quantization always lead to the loss of some information.
15.2. Vector and raster graphics
Depending on the method of generating graphic images, vector and raster methods for encoding graphic images are distinguished.
A vector image is constructed from individual basic objects - graphic primitives: segments, polygons, curves, ovals. The method of creating vector images resembles an application (Fig. 3.6).
Graphic primitives are characterized by the color and thickness of the outline, the color and method of filling the internal area, size, etc. When saving a vector image, information about the graphic primitives that make it up is entered into the computer memory.
For example, to construct a circle, it is necessary to save such initial data as the coordinates of its center, the radius value, the color and thickness of the outline, and the fill color. In this case, both the large and small circles will be described by the same set of data, i.e. the real dimensions of the object do not have any effect on the size of the data stored about it.
In fact, a vector representation is a description in accordance with which the required image is constructed. These kinds of descriptions are represented in the computer as ordinary text information.
A raster graphic image consists of individual small elements - pixels (pixel is an abbreviation for picture element - image element). It looks like a mosaic (Fig. 3.7), made from objects of the same size (multi-colored pebbles, pieces of glass, enamel, etc.).
Rice. 3.6. Paper applique
Rice. 3.7. Fragment of a mosaic canvas at the Moscow metro station "Mayakovskaya"
A raster is a specially organized collection of pixels that represents an image. The coordinates, shape and size of pixels are specified when defining a raster. The pixel attribute that can be changed is color.
In a rectangular raster, the pixels make up a rectangular matrix; its main parameters are the number of columns and rows made up of pixels.
The main advantage of rectangular rasters is that the position of each pixel in the image (or on the screen) does not need to be specified - it is easy to calculate, knowing the dimensions of the raster matrix, the pixel density, which is usually indicated in the number of dots per inch (dpi, from the English. dots per inch), and rules for listing pixels (for example, from left to right and from top to bottom: first, all pixels in the top line are numbered from left to right, then the numbering continues on the next line below, etc.).
So, we have found out how spatial discretization occurs, which allows us to select a finite number of spatial elements, information about which will be stored in computer memory.
It remains to consider the issues of color coding of each spatial element.
Download lesson materials
Coordinate method
Any data can be transmitted using binary numbers, including graphic images, which are a collection of points. To establish correspondence between numbers and points in a binary code, the coordinate method is used.
The plane coordinate method is based on the study of the properties of a point in a coordinate system with a horizontal axis Ox and a vertical axis Oy. The point will have 2 coordinates.
If three mutually perpendicular axes X, Y and Z pass through the origin of coordinates, then the spatial coordinate method is used. The position of the point in this case is determined by three coordinates.
Coordinate system in space
RGB model and color depth
As you know, absolutely any color can be obtained by combining in some proportions three basic colors: red , green and blue . The abbreviation RGB can be deciphered as:
- R – RED (red);
- G – GREEN (green);
- B (BLUE) – blue.
The smallest indivisible element of a graphic image on a user's screen is called a pixel . |
resolution monitor should be understood as a value that determines how many pixels can be placed on the area of a given monitor. The more pixels that fit on the screen area, the sharper and better quality the graphic display will be.
Currently, various professional communities are maintaining statistics (for 2019), reflecting the most popular screen resolutions among users using the Internet.
In the table below I will list only the TOP 3$ most popular monitor resolutions:
№ | Resolution in pixels | % of users |
$1$ | $360 • 640$ | $18.11\%$ |
$2$ | $1366 • 768$ | $15.66\%$ |
$3$ | $1920 • 1080$ | $12.32\%$ |
PS My screen resolution is set to $1920 • $1080. Which is what I recommend to you.
Color depth is a value responsible for the amount of memory required when encoding one pixel. |
It is very important to understand what affects color depth. Color depth is affected by the possible number of different colors that a pixel can take on when encoding graphic information.
What determines the number of different colors? This amount in the RGB model depends on how many bits of memory are allocated to encoding the base color. Let me remind you that there are three basic colors: red, green and blue.
Let's assume that $1$ bytes or $8$ bits of information are allocated for encoding one basic color.
R (red) | G (green) | B (blue) |
$8$ bits ($1$ bytes) | $8$ bits ($1$ bytes) | $8$ bits ($1$ bytes) |
They say that we work with the $24$-bit RGB model when encoding graphics information. That is, each pixel will occupy $24$ bits or $3$ bytes of information in memory.
You can also calculate how many different shades such a pixel can accept. This is very easy to do, since we are interested in all possible combinations of the three basic colors.
To do this, we apply the formula: $2^8 • 2^8 • 2^8 = 16\ 777\ 216$ different shades of color.
When encoding graphic information, absolutely every color from a set consisting of $16\777\216$ different colors is assigned a unique binary code, the length of which is $24$ bits. |
So, we encode graphic information at the level of the $24$-bit RGB model. Let's assume that an ideal red image is being analyzed. All pixels in a given image will be red and will be encoded with the same binary code.
Let's look at the bit representation of a perfectly red pixel.
Color to code | Color converted to binary code |
11111111 00000000 00000000 |
In the resulting binary code, the first $8$ bits are responsible for the red component, the middle $8$ bits are for the green component, and the last $8$ bits are for the blue component.
Since we are considering the encoding of graphic information expressed in ideal red color, the bits responsible for the red color have a value equal to $1$, and the rest - equal to $0$.
Let's return to the quantization operation, which we began to consider above. We carried out a discretization operation, that is, we applied a mesh. Next, we analyze each element, cell of this grid.
The analysis consists of matching the color located in a given cell with the corresponding binary value, which is stored in a special scale.
At this point, the procedure for encoding graphic information is considered complete.
I would like to draw close attention to the fact that tasks for encoding graphic information found on the Unified State Exam often operate with the $24-bit RGB model.
Converting numbers to binary code
Numerical method of encoding information, i.e. the transition of information data into a binary sequence of numbers is widespread in modern computer technology. Any numeric, symbolic, graphic, audio and video information can be encoded with binary numbers. Let's take a closer look at the coding of numerical information.
The number system familiar to humans (based on numbers from 0 to 9), which we actively use, appeared several hundred thousand years ago. The operation of all computer technology is organized on a binary number system. It has a minimal alphabet - 0 and 1. The encoding of numbers is done by switching from the decimal to the binary number system and performing calculations directly with binary numbers.
The encoding and processing of numerical information is determined by the desired result of working with numbers. So, if a number is entered within a text file, it will have a character code taken from the standard used. For mathematical calculations, numerical data is transformed in a completely different way.
The principles of encoding numerical information presented in the form of integers or fractions (positive, negative or equal to 0) differ in nature. The easiest way to convert an integer from decimal to binary is as follows:
- the number must be divided by 2;
- if the quotient is greater than 1, then it is necessary to continue division until the result is equal to 0 or 1;
- write down the result of the last operation and the remainder of the division in reverse order;
- the resulting number will be the desired code value.
One of the most important parts of computer work is the encoding of symbolic information. All the variety of numbers, Russian and Latin letters, punctuation marks, mathematical symbols and individual special designations belong to symbols. The symbolic encoding method consists of assigning an established cipher to a specific character.
Let's take a closer look at the most common ASCII and Unicode standards - what is used to encode character information all over the world.
ASCII table fragment
Initially, it was established that for any sign, 8 bits (1 bit is either “0” or “1”) of the binary sequence are allocated in the computer memory. The first ASCII (American Messaging Code) encoding table contained 256 characters. The limited number of encoded characters, which complicates international data exchange, led to the need to create a Unicode standard based on ASCII. This international encoding system contains 65536 characters. Encoding a huge number of various symbols became possible thanks to the use of 16-bit character encoding.
The encoding of symbolic and numeric information is fundamentally different. To input/output numbers onto a monitor or use them in a text file, they are converted according to the encoding system. In the process of arithmetic operations, a number has a completely different binary meaning, because it goes into the binary number system, where all computational actions are performed.
Choosing a method for encoding information - graphic, numeric or symbolic - must be based on the purpose of the encoding. For example, the number “21” can be entered into computer memory with numbers or letters “twenty-one”, the word “WINTER” can be transmitted in Russian letters “winter” or Latin “ZIMA”, the barcode of a product is transmitted by image and numbers.
Encoding graphic information
Graphic information can be understood as a drawing, a drawing, a photograph, a picture in a book, images on a TV screen or in a cinema, etc. Let's consider the principles of encoding graphic information using the example of an image on a TV screen. This image consists of horizontal lines - rows, each of which in turn consists of the smallest elementary image units - points, which are usually called pixels (picture - PICture'S ELement - picture element). The entire array of elementary image units is called a raster .
The degree of image clarity depends on the number of lines on the entire screen and the number of dots per line, which represent resolution , or simply resolution . The more lines and dots, the clearer and better the image.
If we look at the resolution ratings of modern plasma and LCD TVs, we will find that the most common resolutions are 640x480 (LCD TVs with an aspect ratio of 4:3); 852×480 (plasma panels with an aspect ratio of 16:9), 1024×768 (LCD and plasma panels both 4:3 and 16:9); 1366x768 (HD Ready); 1920x1080 (Full HD) pixels. Some other resolution values are also found, but rarely, such as 800x600 or 1024x1024 pixels.
A resolution designation such as 640x480 means that there are 480 horizontal lines of 640 pixels each. Thus, the image on the screen is a sequence of 640·480=307200 pixels.
Images can be monochrome or color.
A monochrome image consists of any two contrasting colors - black and white, green and white, brown and white, etc. For simplicity of discussion, we will assume that one of the colors is black and the other is white. Then each pixel in the image can be either black or white. By assigning the binary code “0” to the black color, and the code “1” to the white color (or vice versa), we can encode the state of 1 pixel of a monochrome image in 1 bit. However, the resulting image will have too much contrast.
It is generally accepted today, giving fairly realistic monochrome images, to encode the state of 1 pixel using 1 byte, which allows you to transmit 256 different shades of gray from completely white to completely black. In this case, transmitting the entire raster of 640x480 pixels will require 307200 bytes.
A color image can be formed based on various models. The most common color models:
· RGB is most often used in computer science;
· CMYK is the main color model in printing;
· in television, the YUV color model is used for the PAL standard, the YDbDr model for SÉCAM, and the YIQ model for NTSC;
· The XYZ reference model is based on measurements of the characteristics of the human eye.
The RGB model (from the words Red, Green, Blue - red, green, blue) most accurately matches the principles of displaying an image on a monitor screen - three numbers set the brightness of the red, green and blue phosphor grains at a given point on the screen. Therefore, this model is most widely used in the field of computer graphics, focused on viewing images on a monitor screen.
The RGB model is based on the fact that the human eye perceives all colors as the sum of three primary colors - red , green and blue (Fig. 4.1). Since color is formed by adding three colors, this model is often called additive
(summing).
For example, to set white color, you must specify maximum brightness values for all three components, and to set black, you must completely extinguish all sources (for example, phosphor points) that set the color at the desired point in the image, and set zero brightness for them.
If each color is encoded using 1 byte (the brightness of each component is specified by numbers from 0 to 255), as is customary for a realistic monochrome image, it will be possible to transmit 256 shades of each of the primary colors. In total, in this case, the transmission of 256 · 256 · 256 = 16,777,216 different colors is provided, which is quite close to the real sensitivity of the human eye. Thus, with this color encoding scheme, 1 pixel image requires 3 bytes or 24 bits of memory. This method of presenting color graphics is usually called True Color (true color - true color) or full color mode .
There are professional devices (for example, scanners) that allow you to obtain images in which each pixel is described not by three, but by six (16 bits for each color component) or even eight bytes. Such modes are used for the best transmission of shades and, most importantly, the brightness of image pixels. This allows you to most reliably reproduce images of such technically complex scenes, such as evening or dawn landscapes.
Rice. 4.1.
RGB color model represented as a cube
Example 4.7. In Win32, the standard type for representing colors is COLORREF. To define a color in RGB, 4 bytes are used in the form:
0×00BBGGRR
BB, GG, RR - the intensity value of the blue, green and red components of the color, respectively. Their maximum value is 0xFF.
Then you can define a variable of type COLORREF as follows:
COLORREF C=
(
b,g,r
);
b, g
and
r
is 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 is (0,0,0), and white is (255,255,255).
Full color mode requires a lot of memory. Therefore, various memory modes and graphic formats are being developed that convey color a little worse, but require much less memory. In particular, we can mention the High Color mode (high color - rich color), in which 16 bits are used to transmit the color of 1 pixel, and therefore 65,535 color shades can be transmitted, as well as the index mode, which is based on a previously created for this drawing table of the color shades used in it. Then the desired pixel color is selected from this table using a number - an index, which takes up only 1 byte of memory. When recording an image into computer memory, in addition to the color of individual dots, it is necessary to record a lot of additional information - the size of the picture, resolution, brightness of dots, etc. A specific method of encoding all the information required when recording an image into computer memory forms a graphic format. Graphic information encoding formats, based on the transmission of the color of each individual pixel that makes up the image, belong to the group of raster, or BMP (Bit MaP) formats [1].
The CMYK model (Cyan, Magenta, Yellow, blacK) is a subtractive color formation scheme used primarily in printing for standard process printing. The CMYK scheme (Fig. 4.2), as a rule, has a relatively small color gamut [3].
Rice. 4.2.
Scheme of subtractive synthesis in CMYK
In Russian these colors are often called: blue, purple, yellow . The color in such a scheme depends not only on the spectral characteristics of the dyes and on the method of their application, but also on their quantity, the characteristics of the paper and other factors. For example, there are American, European and Japanese standards for coated and uncoated papers.
Although black can theoretically be produced by mixing equal proportions of magenta, cyan and yellow, in practice mixing the actual colors magenta, cyan and yellow results in a more dirty brown or dirty gray color. Since the purity and richness of black is extremely important in the printing process, another color was introduced into the model - black .
The explanation of the first three letters in the abbreviation CMYK is given above, and regarding the fourth, one of the versions claims that K is an abbreviation for English. blac K
(if we took B, there would be confusion with the RGB model, where B is blue).
According to this version, when printing films were printed on them, one letter indicated the color to which they belonged. According to another version, the letter K comes from the abbreviation of English. Key words : In English-speaking countries, the term key plate
refers to a printing plate for black ink.
CMYK is called a subtractive model because this model is used mainly in printing for color printing, and paper and other printed materials serve as surfaces that reflect light: it is more convenient to calculate how much light (and color) was reflected from a particular surface rather than how much absorbed. Thus, if we subtract the three primary colors, RGB, from white, we get a trio of complementary CMY colors. "Subtractive" means "subtractive" - we subtract the primary colors from white.
Each of the numbers that define a color in CMYK represents the percentage of ink of that color that makes up the color combination. For example, to obtain a deep orange color, you would mix 30% cyan, 45% magenta, 80% yellow, and 5% black. This can be denoted as follows: (30,45,80,5). Sometimes they use the following designation: C30M45Y80K5.
Test questions and assignments
1. What is the data format?
2. How are numerical information encoded in computers?
3. How is the range of representation of an integer related to the format of its storage.
4. Are there any differences in the display of positive numbers in forward, reverse and complement codes?
5. Represent the number -78 in one-byte format.
6. How are the precision and range of representation of a real number related to the bit depth of the mantissa?
7. Why is the order when representing a real number called shifted?
8. Why is the first digit of the mantissa not stored when representing a normalized real number?
9. Express the number 34.256 in single real number format.
10. How is text information encoded in computers?
11. What are code tables used for? What code tables do you know?
12. What is the difference between a basic ASCII table and an extended ASCII table?
13. What are the benefits of representing text information in Unicode format?
14. Define the concepts pixel, raster, resolution
.
15. How many bytes of memory are needed to encode an image on a computer monitor screen with a resolution of 800x600 with 256 colors?
16. What models of color image formation do you know?
17. What colors are considered primary in RGB and CMYK models?
5. Basic concepts of logical algebra
Sound conversion
Computer technologies are being successfully implemented in various fields of activity, including coding and processing of audio information. From a physical point of view, sound is an analog continuous signal. The process of translating it into a series of electrical impulses is called encoding sound information.
Problems that need to be solved for successful signal digitization:
- sample (divide audio data into elementary sections by measuring air vibrations at regular intervals);
- digitize (assign a numerical code to each element).
Sound conversion: a) analog signal; b) discrete signal.
The following methods of encoding audio information are distinguished:
- FM method. Its essence comes down to dividing sound by analog-to-digital converters (ADCs) into identical simple elements, which are subsequently encoded with a binary code. The imperfection of the FM method manifests itself in the low quality of sound recording due to the loss of some amount of the original audio message.
- The Wave-Table method allows you to obtain a high-quality product, since the developed tables of samples (samples of “live” sounds) allow you to express various parameters of the incoming signal in binary numbers.
Lesson summary “Coding graphic information”
Computer science lesson notes
Lesson topic:
"Coding of graphic information."
Goals:
- educational
– introduce students to analog and discrete methods of presenting graphic information, introduce dot color coding;
- developmental
–
to develop students’ cognitive interest, computer skills, and note-taking skills; - educational -
to foster independence and responsibility when learning new material, to form the information culture of students, to cultivate attentiveness, accuracy, and discipline.
Requirements for student knowledge and skills:
Students should know: what analog and discrete methods of presenting information represent, what spatial sampling is, the formula for finding colors in a palette.
Students should be able to: solve problems related to finding colors in a palette.
Lesson type:
lesson in learning new knowledge.
Educational methodological and software of the lesson:
- textbook: Ugrinovich N.D. Computer Science and ICT. Basic level: textbook for grade 10 / N.D. Ugrinovich. – 5th ed.‑ M.: Binom. Knowledge Laboratory, 2009. – 212 p.
- Microsoft Office Power Point.
Lesson equipment:
- interactive board;
- computer;
- presentation to accompany the lesson.
Lesson plan:
- Organizational moment (2 min).
- Checking homework (7 min).
- Explanation of new material (15 min).
- Consolidation of new material (17 min).
- Homework (2 min).
- Summing up the lesson (2 min).
During the classes:
- Organizational moment – 2 min.
The teacher welcomes students, checks their readiness for the lesson and those who are absent.
- Checking homework – 7 min.
(Front survey of students on the material covered in the last lesson).
Teacher:
Now we will review the material from the previous lesson, then we will study new material, and at the end of the lesson we will solve several problems.
Teacher:
When are optical character recognition systems used?
Student:
When creating electronic libraries and archives, by converting books and documents into digital computer format, when enterprises are transitioning from paper to electronic document management, and if it is necessary to edit a document received by fax, optical character recognition systems are used.
Teacher:
What recognition methods do optical recognition systems use?
Student:
Raster and structural.
Teacher:
When did handwriting recognition systems begin to be created?
Student:
With the advent of the first pocket computer in 1990.
- Explanation of new material - 15 min.
Teacher:
Well done, you have coped with the questions, now let's start studying a new topic. We open the notebooks, write down the date and topic of the lesson: “Coding graphic information” (slide 1).
With analog representation, a physical quantity takes on an infinite number of values, and its values change continuously. In a discrete representation, a physical quantity takes on a finite set of values, and its values change abruptly. Let's write this down in notebooks (slide 2).
Examples of analog and discrete representation of information include an inclined plane and a staircase. 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 take on an infinite set of continuously changing values from a certain range, and when moving along a staircase, values only from a certain set, and changing abruptly.
Pay attention to Figure 1.1. (slide 3).
Graphic information can be presented in analog and discrete form. An example of an analog representation of graphic information is, for example, a painting whose color changes continuously, and a discrete one is an image printed using an inkjet printer and consisting of individual dots of different colors.
Let's write in notebooks: Conversion of graphic information from analogue to discrete form is carried out by spatial sampling, i.e. breaking a continuous graphic image into separate elements (slide 4).
As a result of spatial sampling, graphic information is presented in the form of a raster image, which is formed from a certain number of lines, which, in turn, contain a certain number of points (pixels).
A raster image is characterized by resolution. Monitor resolution is usually expressed as two integers, for example: 1600x1200. These numbers indicate the horizontal and vertical dimensions of the image in pixels. The resolution of printers and scanners is usually indicated in dpi - this is the number of horizontal and vertical pixels per inch (for example, 2400x1200 dpi).
The higher the resolution of a raster image, the higher the quality, i.e. the smaller the dot size, and, accordingly, the greater the number of dots that make up the image.
In the process of spatial sampling, coding is performed, i.e. assigning each point a specific color value in the form of a code.
The higher the number of colors used, the higher the quality of the discrete image. The combination of colors used forms a color palette.
Let's write the following in our notebooks: The number of colors N in the palette, and the amount of information I required to encode the color of each point (color depth), are interconnected and can be calculated using the formula:
N=2I(slide 5).
The most common color depths when encoding color images are 8, 16, or 24 bits per dot. Knowing the color depth using the formula N=2I, you can calculate the number of colors in the palette.
From a monitor screen, a person perceives color as the sum of the radiation of three basic colors: red, green and blue. This color rendering system is called RGB, after the first letters of the English color names (Red - red, Green - green, Blue - blue).
A person perceives an image printed on paper in reflected light. If no paint is applied to the paper, then the incident white light is completely reflected and we see a white sheet of paper. Once paints are applied, they absorb certain colors. When printing images on printers, a color palette is used in the CMY system, colors in which are formed by subtracting certain colors from white (Cyan - cyan, Magenta - magenta and Yellow).
- Consolidating new material – 17 min.
Teacher:
To consolidate the new material, we will solve the following problems:
Task 1: A black and white (no grayscale) raster graphic image has a size of 10x10 pixels. How much memory will this image take? (slide 6)
Solution: The amount of video memory is calculated by the formula: V = I * X * Y , where
I
is the color depth of an individual point,
X , Y are
the horizontal and vertical dimensions of the screen (the product of x by y is the screen resolution).
Number of points – 100.
Since there are only two colors - black and white, the color depth is 1 (2I = 2).
The memory capacity is: V=I*X*Y=1*10*10=100 bits.
Answer: 100 bits.
Task 2: To store a raster image of 128x128 pixels, 4 KB of memory were allocated. What is the maximum possible number of colors in the image palette? (slide 7)
Solution:
Let's determine the number of image points. 128*128=16384 points or pixels.
The amount of memory for a 4 KB image can be expressed in bits, since V=I*X*Y is calculated in bits. 4 KB=4*1024=4096 bytes = 4096*8 bits =32768 bits
Let's find the color depth I =V/(X*Y)=32768:16384=2
N=2I, where N is the number of colors in the palette. N=4
Answer: 4
Problem 3: How much video memory is needed to store 4 image pages if the bit depth is 24 and the display resolution is 800x600 pixels? (slide
Solution:
Let's find the amount of video memory for one page: 800 * 600 * 24 = 11520000 bits = 1440000 bytes = 1406.25 KB ≈1.37 MB
1.37*4 =5.48 MB ≈5.5 MB for storing 4 pages.
Answer: 5.5 MB.
Task 4: Determine the amount of computer video memory that is necessary to implement the High Color monitor graphics mode with a resolution of 1024 x 768 pixels and a color palette of 65,536 colors. (slide 9)
Solution: Using the formula N=2I, where N is the number of colors, I is the color depth, we determine the color depth. 2I=65536
The color depth is: I = log265,536 = 16 bits.
The number of image pixels is: 1024´768 = 786,432
The required amount of video memory is: 16 bits ´ 786,432 = 12,582,912 bits = 1,572,864 bytes = 1,536 KB = 1.5 MB
Answer: 1.5 MB
- Homework – 2 min.
Teacher:
Guys, please open your diaries and write down your homework (Slide 10).
Entries in diaries: paragraph 1.2.1 and memorize entries in notebooks.
6. Summing up – 2 min.
Teacher:
So, today we learned how graphic information is encoded, got acquainted with the analog and discrete method of representing graphic information, learned what spatial sampling is, and also solved several problems. (Grades are given for work in class).
Self-analysis of a computer science lesson
"Coding of graphic information"
Lesson Objective Analysis
This lesson is conducted according to plan in accordance with thematic planning.
The following objectives were set for the lesson:
- educational
– introduce students to analog and discrete methods of presenting graphic information, introduce dot color coding;
- developmental
–
to develop students’ cognitive interest, computer skills, and note-taking skills; - educational -
to cultivate independence and responsibility when learning new material, to form the information culture of students, to cultivate attentiveness, accuracy, and discipline.
The educational and developmental goals of the lesson correspond to the required level of knowledge and skills of students. The material is selected in accordance with the school curriculum. The educational goal of the lesson is set taking into account the characteristics of the class.
During the lesson, its goals were achieved.
Analysis of the structure and organization of the lesson
The structure of the lesson corresponds to the objectives of the lesson and its type - this is a lesson in mastering new knowledge:
- Organizational moment (2 min).
- Checking homework (7 min).
- Explanation of new material (15 min).
- Consolidation of new material (17 min).
- Homework (2 min).
- Summing up the lesson (2 min).
The stages of the lesson are logically connected. Checking students' homework serves as the basis for further study of the topic. Consolidation of theoretical material contributes to its better assimilation.
Lesson time is distributed rationally across stages.
The lesson is held in a computer lab. To ensure efficient use of class time, students answered questions from their seats. They took an active part in the dialogue.
Before the start of the lesson, an interactive whiteboard was prepared, the date and topic of the lesson were recorded. The lesson was conducted at a fairly fast pace. At the end of the lesson, the results were summed up, homework was assigned, and all students were given grades. Everything planned for this lesson was implemented.
Lesson content analysis
The volume of new material is optimal according to the curriculum. The presentation of the material was consistent and logically correct.
During the lesson, students' attention was focused on basic concepts.
The content of the lesson is very well suited for the formation of independent thinking and active learning activities, for the development of logical thinking in schoolchildren and increasing interest in the subject.
Analysis of lesson methodology
In this lesson, various methodological techniques, methods and means were used: note-taking, conversation, dialogue, problem solving. Methodological techniques corresponded to the age characteristics of the students and the goals set at the beginning of the lesson.
My relationships with students in the classroom were of a cooperative and mutual understanding nature. I was able to quickly get the children ready to work, establish the necessary contact with the students, and establish a microclimate in the classroom that was typical for studying.
During this lesson, a computer presentation was used to accompany the lesson. As the lesson progressed, I made the necessary notes on the interactive whiteboard.
In order to consolidate the new material, several problems were solved.
During the lesson I tried to watch my speech. She was expressive and bright, which helped maintain students’ interest in the lesson, she highlighted important points in her voice, and accurately used special terminology when explaining the theory.
Analysis of students' work in class
The students worked actively at all stages of the lesson. All students have self-control skills, express independent judgment and the depth of their knowledge. During the lesson, the guys tried to help each other, listened carefully to their friend’s answer, and did not interrupt the teacher.
Homework analysis
To check the homework from the previous lesson, an oral survey was conducted using pre-written questions.
At this lesson, homework was also assigned, which was primarily of a consolidating nature. The amount of homework is optimal, covers the required minimum provided by the program, and lays the foundation for further expansion of knowledge and skills.
Assessment of sanitary and hygienic conditions of the lesson
The sanitary condition of the classroom is good, in the office there is natural lighting on the right, artificial lighting from above each desk; Regardless of the location of the sun, there will be no glare in the office. During breaks, the office is ventilated.
The office has an interactive whiteboard, which is an excellent tool for increasing visibility. Notes on the board and slides are visible from all desks.
Students sit in class two at a time at a desk, which is located at a sufficient distance from the computer stations. The school furniture is comfortable. During the lesson, all students sit upright and correctly. Students with vision problems sit on the first two desks, closer to the center.
The office is equipped with school cabinets with the necessary methodological and didactic material, manuals, and textbooks.
Notebook entries alternated with oral discussions of the lesson material, which contributed to the absence of fatigue during the lesson.
Psychological analysis of the lesson
During the lesson, a good emotional background of the class was maintained. The students showed attention and interest at all stages of the lesson. They worked actively while checking homework, learning new material, and solving problems. The content and organization of the lesson contributed to the overall development of the student’s personality and the student body.
Word processing
Text is a meaningful order of signs. With the use of a computer, encoding and processing text information (typing, editing, exchanging and storing written text) has become much easier.
Coding of text information - assigning a code from the coding system to any character of the text. The following encoding standards are distinguished:
- ASCII is the first international coding system containing 256 character codes.
- Unicode is an extended ASCII standard that is 256 times larger in size.
- KOI-8, SR1251, SR866, ISO – Russian letter encoding tables. It should be understood that a document encoded by one standard will not be readable by another.
In tasks for encoding text information, the following concepts are often encountered:
- alphabet power;
- Memory units (bits and bytes).
For example, the capacity of the ASCII alphabet is 256 characters. In this case, one character takes up 8 bits (or 1 byte) of memory, and Unicode takes 35536 characters and 16 bits (or 2 bytes), respectively.
Test No. 1 Coding and processing of graphic and multimedia information, grade 9
Test on the topic:
"Coding and processing of graphic and multimedia information"
Option I
1. Expand the concepts:
a) Pixel
b) Color depth
c) Audio sampling rate
d) GIF animation
2. Describe the basic elements, the basis of graphic objects, and vector graphics editors
3. Color (with a palette of 256 colors) raster graphic image has a size of 45×20 pixels. What is the information volume of the image (write the answer in bytes)?
4. The information volume of an image with dimensions of 20x40 pixels is 800 bytes. Determine the number of colors in the palette used for this image.
5. Determine the required amount of video memory for the graphic mode of the monitor with a spatial resolution of 1440x900 pixels and a color depth of 16 bits.
6. Estimate the information volume of a digital audio file lasting 60 seconds with a coding depth of I=16 bits, stereo and a sound signal sampling rate of 12000 measurements per second. Provide the answer in MBytes
7. Determine the duration of the sound file that will fit on disk (information capacity 700 MB) with low sound quality I=8 bits, mono, 8000 measurements per second.
Test on the topic:
"Coding and processing of graphic and multimedia information"
Option II
1. Expand the concepts:
a) Animation
b) Raster image resolution
c) Audio coding depth
d) Flash animation
2. Describe the basic elements and graphic editors of raster graphics
3. Color (with a palette of 256 colors) raster graphic image has a size of 25×40 pixels. What is the information volume of the image (write the answer in bytes)?
4. The information volume of an image with dimensions of 30x30 pixels is 1012.5 bytes. Determine the number of colors in the palette used for this image.
5. Determine the required amount of video memory for the graphic mode of the monitor with a spatial resolution of 1440x900 pixels and a color depth of 8 bits.
6. Estimate the information volume of a digital audio file lasting 60 seconds with a coding depth of I=16 bits, stereo and a sound signal sampling rate of 24,000 measurements per second. Provide the answer in MBytes
7. Determine the duration of the sound file that will fit on disk (information capacity 700 MB) with low sound quality I=8 bits, stereo, 8000 measurements per second.