Screen diagonal and working resolution of the monitor. BMP data format (bitmap) BMP image data

Practical work No. 5

Subject: Information display devices

Target: understand information display devices.

Work progress

1. Examine the monitor in the laboratory. What are the characteristics

he has? Use PC Wizard 2010 to check your monitor's specifications.

Current display: 1366x768 pixels at 60 Hz in True Colors (32-???)

Touch Support: No

Number of monitors: 1

Monitor type: Samsung S19B300

Video adapter: NVIDIA GeForce GT 430

nVidia CUDA: Yes

2. Draw up circuit diagrams of a TFT multimedia projector and polysi-

Licon multimedia projector from the textbook. Find out

what type of projector is the projector in the laboratory?

TFT projector circuit:

Diagram of poly silicone multimedia projector:

3. Make a diagram of an overhead projector.

Option 7

1. The black and white image of the JPG file type has the size

768 x 768 pixels. Determine the information volume of the file.

Solution:

1)768*768 /8= 73728 bytes

Answer: 73728 bytes

2. Storage bitmap size 64x64 pic.

The villages were allocated 1,024 KB of memory. What is the maximum possible

number of colors in the image palette?

Solution:

1)64 * 64 = 4096

1024* 1024 = 1048576 bits

1048576: 4096 = 256 bits

256= 2^8 = 8 colors

Answer. 8 colors.

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any raster image of size

256 x 128 pixels if you know the image is using

palette of 256 colors. There is no need to store the palette itself.

Solution:

1)356*128/1024=32 bits

Answer: 32 bit

4. During the raster conversion process graphic file

the number of colors decreased from 256 to 32. How many times did the information volume of the file decrease?

Solution:

3)8/5= 1.6 times

Answer: will decrease by 1.6 times

5. The monitor allows you to receive 26,666,256 colors on the screen. How much memory in bytes does one pixel take up?

Solution

1) 26 666 256 = 2^24.

Answer: approximately 24

6. Monitor resolution - 1,024 x 768 pixels, color depth -

64 bit. What is the required amount of video memory for this graphics mode?

Solution:

1)1024*768*64/8= 6291456 bytes


Answer: 6291456 bytes

Control questions:

1. What is the operating principle of a monitor based on

Operating principle CRT based monitors lies in the fact that a beam of electrons emitted by an electron gun, hitting a screen coated with a special substance - a phosphor, causes it to glow

2. What characteristics are the main ones for a CRT monitor?

Monitor screen diagonal– distance between bottom left and right top corner screen, measured in inches. Size visible to the user The screen area is usually slightly smaller, on average 1", than the size of the handset. Manufacturers may indicate two diagonal sizes in the accompanying documentation, with the visible size usually indicated in brackets or marked “Viewable size”, but sometimes only one size is indicated - size tube diagonals. Monitors with a diagonal of 15" have emerged as the standard for PCs, which approximately corresponds to 36-39 cm diagonal of the visible area. To work in Windows, it is advisable to have a monitor size of at least 17". professional work with desktop publishing systems (NIS) and systems computer-aided design(CAD) it is better to use a 20" or 21" monitor.

Screen grain size determines the distance between the nearest holes in the color separation mask of the type being used. The distance between the holes of the mask is measured in millimeters. The smaller the distance between the holes in the shadow mask and the more holes there are, the higher the image quality. All monitors with a grain greater than 0.28 mm are classified as coarse and are cheaper. The best monitors have a grain of 0.24 mm, reaching 0.2 mm for the most expensive models.

Monitor resolution determined by the number of image elements that it is capable of reproducing horizontally and vertically. Monitors with a screen diagonal of 19" support resolutions up to 1920 * 14400 and higher.

3. What are the features of multimedia monitors?

In multimedia monitors, the speakers are installed inside the monitor body and are located either on the sides of the screen or under the screen. If there is a built-in speaker system, specific requirements are imposed on the shape and design of the monitor housing, since it must not only have a good design, but also provide the necessary resonant properties to obtain high-quality sound.

4. What physical phenomena is the operation based on?

LCD monitors?

LCD monitor screens (LiquidCrystalDisplay, liquid crystal monitors) are made of a substance (cyanophenyl), which is in a liquid state, but at the same time has some properties inherent in crystalline bodies. In fact, these are liquids that have anisotropy of properties (in particular optical ones) associated with order in the orientation of molecules.

5. What factors need to be taken into account when choosing

monitor?

Screen diagonal and working resolution monitor

The selection of monitors in stores is huge. But which format should you choose? Almost square 5:4 or widescreen 16:9?

Obsolete 5:4 format, these are mainly 17- and 19-inch monitors. There are fewer and fewer of these left on sale. You need to keep in mind that these monitors, despite different screen sizes, have the same resolution of 1280x1024 pixels. But if on a 19-inch screen a standard A4 page can be read when expanded to full screen, then the same page on a 17-inch screen looks small.

Currently sold in stores mainly widescreen 16:9 monitors. Considering that on home computer the user watches movies, then this format will come in handy. The image will be full screen. And a wide image is more physiological, more familiar to our eyes.

Monitor resolution. Stores now sell mostly monitors with a resolution of 1366x768, 1920x1080. The first ones are cheaper. But 1920x1080 (FullHD resolution) is the resolution of modern LCD TVs. The highest quality films are in this resolution. Therefore, if you think about the future, then you need to buy a monitor with a resolution of 1920x1080. It will not be possible to set a different resolution, as was possible with CRT monitors. The point is that the matrix LCD monitor can only work fully in its working resolution. Other resolutions are supported, you can set them, but the quality will be ugly. Firstly, the image will be distorted due to a violation of the aspect ratio. Secondly, image blur is the downside of the relatively large pixel size and its strictly rectangular shape. Therefore, in LCD monitors, unlike CRT monitors, only its “native” working resolution should appear.

Monitor screen size. Widescreen monitors from 18.5" are on sale. The resolution of such small monitors is 1366x768. If it doesn’t matter what kind of monitor you have, just to access the Internet, then such a monitor is quite enough. If you want to buy a monitor with a resolution of 1920x1080, then such monitors have a screen size of 21.5”. But with the same resolution of 1920x1080, the same amount of information fits on the monitor screen. And if on a 23-inch screen the page can be read from a distance, then on a 21.5-inch screen the text will be too small, even if you wear glasses!

So for comfortable work on a monitor with a screen resolution of 1920x1080, the most suitable screen size is 23 inches.

BMP is a popular uncompressed bitmap image format. The file header contains information about the image - file size, width and height of the image, pixel depth, number of colors. The title may be followed by a palette. Next comes the actual pixel data set, which identifies the position of each pixel and its color. BMP files support several different color depths, from black and white (1 bit) to Deep color (64 bit). Support for partial transparency of various bit depths has been implemented. The advantage of the format is the fact that the image is stored without loss of quality. However, the larger the geometric dimensions of the BMP image and the color depth, the larger size file. For example, the size of a regular photo with a color depth of 24 bits can easily reach 15 MB or more. Therefore, the scope of targeted application of the format is limited. It is mainly used for large monochrome images - pictograms, diagrams, drawings - where accurate rendering of details is very important. BMP format support is integrated into Windows, so the file can be opened double click mice.

The .bmp file extension represents a bitmap. Viewing and processing of a raster image in BMP format is possible using following programs: Adobe Photoshop CC, Adobe Photoshop Elements 14, Adobe Illustrator CC, Corel PaintShop Pro X9. Also, the listed programs can convert images, pictures and drawings of this format.

Overhead projector designed to demonstrate an image previously applied using felt-tip pens or a printer and copier on transparent film. The image is placed on the working field of an overhead projector, which is illuminated with a special one, and then projected onto the screen using a Fresnel lens. Depending on optical

The light beam transmission patterns distinguish overhead projectors operating in passing And reflected light.

Overhead projection consists of projecting images on transparent media of various formats (film, filmstrips, transparencies, slides and microcopies) onto a screen in transmitted light.

Diascope – a projection device for reproducing still images from transparent and opaque media on a screen. The operating principle of a diascope is that the light stream from a light source with a spherical reflector (reflector) is directed to a condenser (two lenses), which increases the intensity of the light flux. The projection object is positioned between the condenser and the lens, which magnifies the sharply focused image.

Overhead projectors for slides have automatic systems their quick change, autofocus, remote control, sequence and time programming, showing transparencies loaded into a cassette or round magazine, are equipped with audio tape recorders.

Frame projectors designed for demonstrating transparencies in a cassette with changing frames manually, remotely with semi-automatic or automatic control.

Epiprojectors – project opaque objects (pages, pictures, maps, graphs, diagrams, drawings, photographs and small flat objects) onto the screen in reflected light. The principle of their operation is that the light flux reflected from the projection object is directed to the screen using a lens and a mirror. To prevent light from entering the room, the device is placed in a housing. Epiprojectors are faster than overhead projectors, but they have worse quality and brightness of the image on the screen.

Video projectors display on big screen video signals generated by VCRs, video disc players, analog video cameras, digital photos video cameras, television receivers, personal computers and etc.

Devices that allow you to project static and dynamic signals from various audio and video sources onto the screen, either separately or in combination, and even simultaneously with several sources, are called multimedia projectors.

Monitor is a device designed to visually display information. Monitors can be classified according to different parameters. Let's look at the different classifications.

By type of information displayed monitors are distinguished:

1. Alphanumeric:

· Displays that display only alphanumeric information;

· Displays displaying pseudo-graphic symbols;

Intelligent displays with editing capabilities and data pre-processing

2. Graphic for displaying text and graphic information:

· Vector – laser light show;

· Raster – used in almost every PC graphics subsystem. Nowadays, this type of display is usually called raster display, since each element of the image on the screen corresponds to one or more bits of video memory.

Depending on the type of screen there are:

1. CRT monitors - based on a cathode ray tube;

2. LCD monitors – based on liquid crystals;

3. plasma monitors – based on a plasma panel;

4. projectors – video projector and screen, placed separately or combined in one housing;

5. OLED monitors - implement OLED technology (Organic Light-Emitting Diode - organic light-emitting diode);

6. virtual retinal monitors – use output device technology that forms an image directly on the retina of the eye;

7. laser monitors – based on a laser panel.

By display dimension monitors are divided into the following types:

1. two-dimensional (2D) – one image for both eyes;

2. three-dimensional (3D) – a separate image is formed for each eye in order to obtain a volume effect.

By video adapter type monitors are distinguished:

By interface cable type monitors are classified as follows:

1. composite;

2. separate;

Classification of monitors by type of device used:

1. on TVs;

2. in computers;

3. in phones;

4. in calculators;

5. at information kiosks;

6. in navigators.

Touch screen - an information input device that is a screen that responds to touch.

Table 4.1 Advantages and disadvantages of using touch screens

Device

Advantages

Flaws

Pocket

Simplicity of the interface

High power consumption

The device can combine small dimensions and a large screen

There is no tactile feedback - it is difficult to work in shaking conditions. Blind dialing is not possible.

Speed ​​dialing in a relaxed environment

Expanding widely multimedia capabilities apparatus

You have to either use two hands or make large interface elements that can be pressed with a finger.

Thin screen models, even with minor damage, risk being cracked or even broken.

Stationary

Increased reliability

For screens that respond to fingers, there is no tactile feedback.

Resistance to harsh external influences, dust and moisture protection.

When working with a vertical screen, the user is forced to keep his hand suspended. Therefore, vertical screens are only suitable for occasional use in devices such as ATMs.

On a horizontal screen, hands block the view.

Even with a sharp pen, it limits the positioning accuracy of the operator's actions on touch screens without cursor.

Without special coatings, fingerprints may bother the user.

Practical part

1. Draw up the circuit diagrams of a TFT multimedia projector and a polysilicon multimedia projector. Describe the principle of operation.

2. Draw a diagram of an overhead projector. Describe the principle of operation.

3. Draw diagrams of an overhead projector and an epiprojector.

4. Solve problems using options.

5. Answer the security questions.

OPTION 1

1. A black and white image of a BMP file has a size of 1024x768 pixels. Determine the information volume of the file.

2. To store a raster image measuring 32x32 pixels, 512 bytes of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 64x64 pixel bitmap image if you know that the image uses a palette of 256 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphics file, the number of colors was increased from 256 to 1024. How many times did the information volume of the file increase?

5. The monitor allows you to receive 34,345,654 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution 1280x1024 pixels, color depth - 64 bits. What is the required amount of video memory for this graphics mode?

OPTION 2

1. A 256-color drawing contains 1 KB of information. How many points does it consist of?

2. To store a raster image measuring 128x128 pixels, 4 KB of memory were allocated. What is the maximum possible number of colors in the image palette.

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 32x32 pixel bitmap image if you know that the image uses a palette of 128 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphics file, the number of colors was increased from 8 to 256. How many times did the information volume of the file increase?

5. The monitor allows you to receive 33,333,316 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 800x600 pixels, color depth – 32 bits. What is the required amount of video memory for this graphics mode?

OPTION 3

1. A black and white image of a JPG file has a size of 1024x768 pixels. Determine the information volume of the file.

2. To store a raster image measuring 64x64 pixels, 1024 bytes of memory were allocated. What is the maximum possible number of colors in the image palette?

4. In the process of converting a raster graphics file, the number of colors was increased from 64 to 1024. How many times did the information volume of the file increase?

5. The monitor allows you to receive 216,222,216 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 1280x1024 pixels, color depth – 32 bits. What is the required amount of video memory for this graphics mode?

OPTION 4

1. A 128-color drawing contains 1 MB of information. How many points does it consist of?

2. To store a raster image measuring 256x256 pixels, 3 KB of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 64x64 pixel bitmap image if you know that the image uses a palette of 128 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphics file, the number of colors was increased from 32 to 256. How many times did the information volume of the file increase?

5. The monitor allows you to receive 17,123,216 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 640x480 pixels, color depth – 4 bits. What is the required amount of video memory for this graphics mode.

OPTION 5.

1. A black and white image of a BMP file has a size of 1024x1024 pixels. Determine the information volume of the file.

2. To store a raster image measuring 32x32 pixels, 1024 bytes of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 128x128 pixel bitmap image if you know that the image uses a palette of 256 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphics file, the number of colors was increased from 16 to 512. How many times did the information volume of the file increase?

5. The monitor allows you to receive 62789216 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 640x480 pixels, color depth – 16 bits. What is the required amount of video memory for this graphics mode?

OPTION 6

1. A 256-color drawing contains 12 KB of information. How many points does it consist of?

2. To store a raster image measuring 128x128 pixels, 14 KB of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 32x64 pixel bitmap image if you know that the image uses a palette of 64 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphic file, the number of colors was increased from 32 to 1024. How many times did the information volume of the file increase?

5. The monitor allows you to receive 13,345,216 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 800x600 pixels, color depth – 16 bits. What is the required amount of video memory for this graphics mode?

OPTION 7

1. A black and white image of a JPG file has a size of 768x768 pixels. Determine the information volume of the file.

2. To store a raster image measuring 64x64 pixels, 1024 KB of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 256x128 pixel bitmap image if you know that the image uses a palette of 256 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphics file, the number of colors decreased from 256 to 32. How many times did the information volume of the file decrease?

5. The monitor allows you to get 26 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 1024x768 pixels, color depth – 64 bits. What is the required amount of video memory for this graphics mode?

OPTION 8

1. A 64-color drawing contains 20 MB of information. How many points does it consist of?

2. To store a raster image measuring 128x256 pixels, 13 KB of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 1024x512 pixel bitmap image if you know that the image uses a palette of 256 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphics file, the number of colors decreased from 256 to 8. How many times did the information volume of the file decrease?

5. The monitor allows you to get 36 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 640x480 pixels, color depth – 8 bits. What is the required amount of video memory for this graphics mode?

OPTION 9

1. A black and white image of a BMP file has a size of 1024x512 pixels. Determine the information volume of the file.

2. To store a raster image measuring 512x512 pixels, 512 bytes of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 34x64 pixel bitmap image if you know that the image uses a palette of 16 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphics file, the number of colors decreased from 1024 to 16. How many times did the information volume of the file decrease?

5. The monitor allows you to receive 23 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 1024x768 pixels, color depth – 32 bits. What is the required amount of video memory for this graphics mode?

OPTION 10

1. A 128-color drawing contains 11 KB of information. How many points does it consist of?

2. To store a raster image measuring 64x128 pixels, 42 KB of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 64x64 pixel bitmap image if you know that the image uses a palette of 32 colors. There is no need to store the palette itself.

5. The monitor allows you to receive 16 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 800x600 pixels, color depth – 17 bits. What is the required amount of video memory for this graphics mode?

OPTION 11

1. A black and white image of a JPG file has a size of 1024x512 pixels. Determine the information volume of the file.

2. To store a raster image measuring 128x128 pixels, 2048 bytes of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 64x64 pixel bitmap image if you know that the image uses a palette of 256 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphics file, the number of colors decreased from 1024 to 64. How many times did the information volume of the file decrease?

5. The monitor allows you to get 32 ​​colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 1280x1024 pixels, color depth – 16 bits. What is the required amount of video memory for this graphics mode?

OPTION 12

1. 64-color drawing contains 512 MB of information. How many points does it consist of?

2. To store a raster image measuring 256x256 pixels, 53 KB of memory were allocated. What is the maximum possible number of colors in the image palette?

3. Specify the minimum amount of memory (in kilobytes) sufficient to store any 265x256 pixel bitmap image if you know that the image uses a palette of 256 colors. There is no need to store the palette itself.

4. In the process of converting a raster graphics file, the number of colors decreased from 512 to 32. How many times did the information volume of the file decrease?

5. The monitor allows you to receive 61 colors on the screen. How much memory in bytes does one pixel take up?

6. Monitor resolution – 1024x768 pixels, color depth – 20 bits. What is the required amount of video memory for this graphics mode?

OPTION 13

1. Black and white raster graphic image has a size of 1200´256 pixels. How much memory will this image take?

2. To store a raster image measuring 256 x265 pixels, 120 KB of memory were allocated. What is the maximum possible number of colors in the image palette.

3. How much video memory is needed to store four pages of images if the bit depth is 24 and the display resolution is 800 x 600 pixels?

4. Determine the amount of computer video memory that is necessary to implement the High Color monitor graphic mode (16 bits per pixel) with a resolution of 1024 x 768 pixels and a color palette of 65536 colors.

5. During the raster conversion process graphic image the number of colors has decreased from 65536 to 16. How many times will the amount of memory it takes up decrease?

6. Is 256 KB of video memory enough to operate the monitor in 640 ´ 480 mode and a palette of 16 colors?

In today's lesson we will look at the first file format on our path. Different file formats are designed to store different information. Each format specifies a way to organize data in a file.

We will get to know many different file formats: images, three-dimensional models, audio files, video files. Let's start with one of the simplest graphic formats- BMP.

BMP - bitmap - bitmap. The concept of "mapping" is taken from mathematics. In mathematics, a mapping is very close to the concept of a function. For simplicity, consider the word bitmap to be a picture (even though it is not).

Information about BMP file(bmp file header)

Each bitmap file has a header of 14 bytes. Fields for this header:

2 bytes. BM string (on Windows).
4 bytes. File size in bytes.

2 bytes. Reserved field. Must be initialized to zero.
4 bytes. The address from which the image itself begins. Or in other words - an offset to the beginning of the image.

Let's create a 100x100 pixel image. Each pixel takes up 32 bits. The file header will look like this:

B.M.
14+40+100*100*4
0
0
14+40

Important note: these numbers are actually stored as a sequence of bytes. I hope this is clear. Here (and in the next example) I have arranged them in a column for ease of perception.

Let's deal with the second field. 14 - file header size. 40 is the size of the image title (more about it below), 100*100 is the number of pixels. And besides, since we agreed that each pixel will occupy 32 bits (4 bytes), we need to multiply the number of pixels by four.

Last field: The image itself begins immediately after the file header (14 bytes) and the image header (40 bytes).

BMP Image Information (Image Header)

There are several versions of BMP. You can determine the version by the size of the image title. We will use the Windows V3 version, which takes up 40 bytes. Other versions take 12, 64, 108, 124 bytes.

In WinAPI for storing bmp Windows versions V3 uses the BITMAPINFOHEADER structure.

Windows V3 header fields:

4 bytes. Header size. Always set to 40 bytes.
4 bytes. The width of the image in pixels.
4 bytes. The height of the image in pixels.
2 bytes. This field always contains one.
2 bytes. Color depth is the number of bits in a pixel.
4 bytes. Compression method.
4 bytes. Image size. The size of the image itself is indicated here - without taking into account the size of the headers.
4 bytes. Horizontal resolution in pixels per meter (the number of pixels in one meter).
4 bytes. Vertical resolution in pixels per meter (the number of pixels in one meter).
4 bytes. Number of colors in the palette.
4 bytes. The number of important colors in the palette.

Now let's see what the image title will look like in our case:

40
100
100
1
32
0
100*100*4
2795
2795
0
0

For the compression method, we chose 0 - no compression. Other values ​​are possible. Among the interesting ones: BI_JPEG (value - 4) - compression used in jpeg images and BI_PNG (value - 5) - compression used in png images.

We set the horizontal and vertical resolution to 2795. In most graphic editors When creating an image, the resolution is set to 71 pixels per inch (ppi - pixel per inch)). So, 71ppi is 2795 pixels per meter. Resolution is used to give the image physical length (for output to a printer, for example).

After the headings there is a color palette. If it is not there, then the image immediately begins after the headings. We will not consider images with palettes for now.

Data BMP images

An image is made up of pixels. The pixel format is determined by the color depth (see above). In our example we used 32 bits per pixel. 32-bit color usually consists of four channels: alpha (transparency), red, green, blue: ARGB (Alpha, Red, Green, Blue). Sometimes the alpha channel is not used, in which case the image can still occupy 32 bits, they just do not pay attention to the values ​​​​of one channel when calculating. In this case, the channel names are written as follows: XRGB.

Each channel occupies 8 bits (1 byte) and can take 256 values: from zero to 255 (0x00 to 0xff).

In bmp, the image is stored line by line from bottom to top, i.e. The bottom lines are written first, then the top ones. Make sure of this: load one of the images from the first exercise and save only half the lines of that image to another file.

At 32-bit color depth, channels in bmp are written as follows: BGRA. In this order: blue, green, red, alpha.

The size of the data line in the bmp image must be a multiple of four (in bytes). If this is not the case, then the string is padded with zeros. This happens if 1,2,4,8,16,24 bits per channel are used. For example, we have an image that is 3 pixels wide and we are using 16-bit color. Line width: 16*3 = 48 (6 bytes). But the length of the line must be a multiple of four, so two more bytes are added and the length of the line in this example will be eight bytes. Although the last two bytes of each line will not store useful information. It is necessary to take into account the condition that the line size is a multiple of four when working with non-32-bit images.

Now let's continue with our example and use the code to create an image. Each pixel will be initialized with a random color:

Std::ofstream os("temp.bmp", std::ios::binary); unsigned char signature = ("B", "M"); unsigned int fileSize = 14 + 40 + 100*100*4; unsigned int reserved = 0; unsigned int offset = 14 + 40; unsigned int headerSize = 40; unsigned int dimensions = ( 100, 100 ); unsigned short colorPlanes = 1; unsigned short bpp = 32; unsigned int compression = 0; unsigned int imgSize = 100*100*4; unsigned int resolution = ( 2795, 2795 ); unsigned int pltColors = 0; unsigned int impColors = 0; os.write(reinterpret_cast (signature), sizeof(signature)); os.write(reinterpret_cast (&fileSize), sizeof(fileSize)); os.write(reinterpret_cast (&reserved), sizeof(reserved)); os.write(reinterpret_cast (&offset), sizeof(offset)); os.write(reinterpret_cast (&headerSize), sizeof(headerSize)); os.write(reinterpret_cast (dimensions), sizeof(dimensions)); os.write(reinterpret_cast (&colorPlanes), sizeof(colorPlanes)); os.write(reinterpret_cast (&bpp), sizeof(bpp)); os.write(reinterpret_cast (&compression), sizeof(compression)); os.write(reinterpret_cast (&imgSize), sizeof(imgSize)); os.write(reinterpret_cast (resolution), sizeof(resolution)); os.write(reinterpret_cast (&pltColors), sizeof(pltColors)); os.write(reinterpret_cast (&impColors), sizeof(impColors)); unsigned char x,r,g,b; for (int i=0; i< dimensions; ++i) { for (int j=0; j < dimensions; ++j) { x = 0; r = rand() % 256; g = rand() % 256; b = rand() % 256; os.write(reinterpret_cast(&b),sizeof(b)); os.write(reinterpret_cast (&g),sizeof(g)); os.write(reinterpret_cast (&r),sizeof(r)); os.write(reinterpret_cast (&x),sizeof(x)); ) ) os.close();

As a result of executing this code, a temp.bmp file will be created in the folder with your project (if you ran the program through the debugger (F5)) or in the Debug folder of the solution (if you ran the executable file.exe), which can be opened in any image viewer. The image consists of colored dots.

Laboratory work No. 4.

“Presentation of information in a computer. Information coding"

Exercise:

    Test “Measuring Information” (12 questions = 10 min).

    Solve problems on the topic:

Task 1. 119 athletes participate in cyclocross. A special device registers each participant's passing of the intermediate finish, recording its number using the minimum possible number of bits, the same for each athlete. What is the information volume of the message recorded by the device after 70 cyclists have completed the intermediate finish?

1) 70 bits 2) 70 bytes 3) 490 bits 4) 119 bytes

Task 2. How many binary digits are necessary and sufficient to encode one school grade?

1) 1 2) 2 3) 3 4) 4

Task 3. How many different combinations can be made using four binary digits?

1) 2 2) 4 3) 8 4) 16

Task 4. For a computer card game, 36 cards are used (4 suits of 9 cards). The binary code of each card consists of two parts: the suit code and the card code. How many bits should be allocated for card encoding (suit code + card code of a given suit)?

1) 2 + 3 2) 2 + 4 3) 1+4 4) 3 + 3

Task 5. One boy, in order to accurately determine who is ringing the doorbell, suggested that his friends use combinations of long and short rings of 3. He distributed individual combinations to all his friends, and he still had 2 combinations left for his parents. How many friends does the boy have?

1) 4 2) 6 3) 8 4) 2

Task 6. For communication in the tribal language, 13 basic concepts and 4 connectives are used to connect these concepts. The tribe uses binary code to transmit messages; a combination of voiced and dull drum sounds. Messages are transmitted in portions - concept + connective. How many beats will it take to encode each portion of the message?

1) 6 2) 4 3) 8 4)2

Task 7. Assuming that each character is encoded by one byte, estimate the information volume of the following sentence from Pushkin’s quatrain:

The singer-David was small in stature, but he knocked down Goliath!

1) 400 bits 2) 50 bits 3) 400 bytes 4) 5 bytes

Task 8. A message has been received with an information volume of 32 bits. What is this volume in bytes?

1) 5 2) 2 3) 3 4) 4

Task 9. Choose the correct continuation of the statement: “The smallest unit of measurement of the amount of information is...”

1) 1 bar 2) 1 baud 3) 1 bit 4) 1 byte

Problem 10. Scout A. Belov must convey the message: “The meeting place cannot be changed. Eustace". The direction finder determines the location of the transmission if it lasts at least 2 minutes. At what speed (bit/s) should a reconnaissance radiogram be transmitted?

1) 1 bit/s 2) 2 bit/s 3) 3 bit/s 4) 4 bit/min

Problem 11. When connected to the Internet, the modem provides a data transfer rate of 28,800 bps. How long will it take to transfer a 72,000 byte file?

1) 5 seconds 2) 10 seconds 3) 20 seconds 4) 60 seconds

Problem 12. Arrange the units of measurement of the amount of information in ascending order.

A) Gigabyte B) Megabit C) Megabyte D) Terabyte

Problem 13. A 256-color drawing contains 1 KB of information. How many points does it consist of?

1) 128 2) 256 3) 512 4) 1024

Problem 14. The chessboard consists of 64 fields: 8 columns by 8 rows. What is the minimum number of bits required to encode the coordinates of one chessboard?

1) 4 2) 5 3) 6 4) 7

Problem 15. A code consisting of decimal digits is used to transmit a secret message. In this case, all digits are encoded with the same (minimum possible) number of bits. Determine the information volume of a message of 150 characters.

1) 600 bits 2) 750 bits 3) 1200 bits 4) 60 bytes

Problem 16. The information volume of one point of a black-and-white raster image is equal to:

1) 1 bit 2) 2 bits 3) 1 byte 4) 2 bytes

Problem 17. The information volume of one point of a 16-color raster image is equal to:

1) 1 bit 2) 2 bits 3) 3 bits 4) 4 bits

Problem 18. The information volume of one point of a 256-color raster image is equal to:

1) 1 bit 2) 1 byte 3) 2 bits 4) 2 bytes

Problem 19. . How will the information volume of a graphic file change if the original number of colors was 256, but as a result of transformations, 16 colors were set?

1. Will increase 2 times.

2. Will increase 4 times.

3. Will decrease by 2 times.

4. Will decrease by 4 times.

Problem 20. How will the information volume of a graphic file change if the original number of colors was 216, but as a result of transformations, 232 colors were set?

1. Will increase 2 times.

2. Will increase 4 times.

3. Will decrease by 2 times.

4. Will decrease by 4 times.

Problem 21. A color image using 16 colors is converted to black and white. How will the information volume of a graphic file change?

1. Will decrease by 2 times.

2. Will decrease by 4 times.

3. Will decrease by 8 times.

4. Will decrease by 16 times.

Problem 22. . A 256-color BMP file image has a size of 1024 x 768 pixels. Determine the information capacity of the file.

1) 768 Kbps 2) 64 Kbps 3) 768 Kbps 4) 192 Mbps

Problem 23. A black and white image of a BMP file has a size of 1024 x 768 pixels. Determine the information capacity of the file.

1) 768 MB 2) 768 KB 3) 96 KB 4) 96 KB

Problem 24. How many times will the information capacity of a file containing a raster image increase if its color depth is increased from the “black and white” standard to the “65,536 colors” standard?

1) 8 2) 16 3) 32 4) 64

Problem 25. How many times will the information capacity of a file containing a raster image increase if its color depth is increased from the “black and white” standard to the “4,294,967,296 colors” standard?

1) 8 2) 16 3) 32 4) 64

Problem 26. How much video card memory will a 32-bit BMP file with a screen size of 1024 x 768 pixels take up?

1) 3 KB 2) 24 KB 3) 3 MB 4) 24 MB

Problem 27. A regular traffic light without additional sections gives six types of signals (continuous red, yellow and green, flashing yellow and green, red and yellow simultaneously). The electronic traffic light control device sequentially reproduces the recorded signals. 100 traffic lights were recorded in a row. In bytes, this information volume is

1) 37 2) 38 3) 50 4) 100

Problem 28. The light board consists of light bulbs. Each light bulb can be in one of three states (“on”, “off” and “blinking”). What is the smallest number of light bulbs that should be on the display so that it can transmit 18 different signals?

1) 6 2) 5 3) 3 4) 4

Problem 30. The automatic device recoded the information message in Russian, originally written in 16-bit Unicode, into 8-bit KOI-8 encoding. At the same time, the information message was reduced by 480 bits. What is the length of the message in characters?

1) 30 2) 60 3) 120 4) 480

Problem 31. Unicode uses two bytes for each character. Determine the information volume of a word of twenty-four characters in this encoding.

1) 384 bits 2) 192 bits 3) 256 bits 4) 48 bits

Problem 32. Assuming that each character is encoded in one byte, estimate the information volume of the following sentence:

“My uncle had the most honest rules, When he was seriously ill, He made him respect himself And he couldn’t think of anything better.”

1) 108 bits 2) 864 bits 3) 108 kilobytes 4) 864 kilobytes

Problem 33. Specify the type of computer graphics resulting from scanning an image.