Solving problems for encoding graphic information. Does the number of flowers in a bouquet matter? The number of colors in the image

Visit almost any photography forum and you will surely stumble upon a discussion regarding the benefits of RAW and JPEG files. One of the reasons some photographers prefer RAW format is the greater bit depth (color depth) * contained in the file. This allows you to take photos of higher technical quality than what you can get from a JPEG file.

*Bitdepth(bit depth), or Colordepth(color depth, in Russian this definition is often used) - the number of bits used to represent color when encoding one pixel of raster graphics or video. Often expressed in units of bits per pixel (bpp). Wikipedia

What is color depth?

Computers (and devices that are controlled by embedded computers, such as digital SLR cameras) use a binary number system. Binary numbering consists of two digits - 1 and 0 (as opposed to the decimal numbering system, which includes 10 digits). One digit in the binary system is called a "bit" (English "bit", abbreviated from "binary digit", "binary digit").

An eight-bit number in binary looks like this: 10110001 (equivalent to 177 in decimal). The table below shows how this works.

The maximum possible eight-bit number is 11111111 - or 255 decimal. it significant figure for photographers, as it occurs in many imaging programs as well as older displays.

Digital photography

Each of the millions of pixels in a digital photograph corresponds to an element (also called a “pixel”) on the sensor (sensor array) of a camera. These elements, when hit by light, generate a weak electrical current, which is measured by the camera and recorded in a JPEG or RAW file.

JPEG files

JPEG files record color and luminance information for each pixel in three eight-bit numbers, one number each for the red, green, and blue channels (these color channels are the same as those you see when building a color histogram in Photoshop or on your camera).

Each 8-bit channel records color on a scale of 0-255, providing a theoretical maximum of 16,777,216 shades (256 x 256 x 256). The human eye can distinguish approximately 10-12 million colors, so this number provides a more than satisfactory amount of information for displaying any object.

This gradient was saved in a 24-bit file (8 bits per channel), which is enough to reproduce soft gradation of colors.

This gradient was saved as a 16-bit file. As you can see, 16 bits is not enough to render a soft gradient.

RAW files

RAW files assign more bits to each pixel (most cameras have 12 or 14 bit processors). More bits means more number, and therefore more tones per channel.

This does not equate to more colors - JPEG files can already record more colors than the human eye can perceive. But each color is preserved with a much finer gradation of tones. In this case, the image is said to have a greater color depth. The table below illustrates how bit depth equates to tint count.

Processing inside the chamber

When you set up the camera to record photos in JPEG mode, the camera's internal processor reads the information received from the sensor at the moment you take the photo, processes it according to the parameters set in the camera menu (white balance, contrast, color saturation, etc.). and writes it as an 8-bit JPEG file. All Additional Information received by the sensor is discarded and lost forever. As a result, you use only 8 bits out of 12 or 14 possible, which the sensor is able to capture.

Post-processing

A RAW file differs from a JPEG file in that it contains all the data captured by the camera's sensor during the exposure period. When you process a RAW file using RAW conversion software, the program performs conversions similar to what the camera's internal processor does when you shoot in JPEG. The difference is that you set the parameters within the used program, and those set in the camera menu are ignored.

The benefit of the extra bit depth of the RAW file becomes apparent in post-processing. A JPEG file is worth using if you are not going to do any post-processing and you just need to set the exposure and all other settings while shooting.

However, in reality most of us want to make at least a few corrections, even if it's just brightness and contrast. And this is exactly the moment when JPEGs start to give way. With less information per pixel, when you make adjustments to brightness, contrast, or color balance, hues can visually separate.

The result is most evident in areas of gradual and continuous gradation, such as in blue skies. Instead of a soft gradient from light to dark, you will see layering of color stripes. This effect is also known as posterisation. The more you adjust, the more it appears in the image.

With a RAW file, you can make much more dramatic changes in color hue, brightness, and contrast before you see a drop in image quality. Several functions of the RAW converter, such as adjusting the white balance and highlight recovery, also allow you to do this.

This photo is taken from a JPEG file. Even at this size, streaks are visible in the sky as a result of post-processing.

On closer inspection, the sky shows a posterization effect. Working with a 16-bit TIFF file can eliminate, or at least minimize, the banding effect.

16-bit TIFF files

When you process a RAW file, your software gives you the option to save it as an 8 or 16 bit file. If you're happy with the processing and don't want to make any more changes, you can save it as an 8-bit file. You will not notice any difference between an 8 bit and 16 bit file on your monitor or when you print an image. An exception is when you have a printer that recognizes 16-bit files. In this case, you can get a better result from a 16 bit file.

However, if you plan on doing post-processing in Photoshop, then it is recommended that you save the image as a 16-bit file. In this case, the image from a 12 or 14 bit sensor will be "stretched" to fill a 16 bit file. After that, you can work on it in Photoshop knowing that the extra color depth will help you achieve maximum quality.

Again, when you have completed the processing, you can save the file as an 8-bit file. Magazines, book publishers and stocks (and just about any customer buying photography) require 8-bit images. 16 bit files may only be required if you (or someone else) intend to edit the file.

This is the image I got using the RAW + JPEG setting on the EOS 350D. The camera saved two versions of the file - a JPEG processed by the camera's processor and a RAW file containing all the information recorded by the camera's 12-bit sensor.

Here you can see a comparison of the upper right corner of the processed JPEG file and the RAW file. Both files were created by the camera with the same exposure setting and the only difference between them is the color depth. I was able to "stretch" the "overexposed" details in the RAW file that were not visible in JPEG. If I wanted to work on this image further in Photoshop, I could save it as a 16-bit TIFF file to ensure the best possible image quality during processing.

Why do photographers use JPEG?

The fact that not all professional photographers use RAW all the time doesn't mean anything. Both wedding and sports photographers, for example, often work with the JPEG format.

For wedding photographers who can capture thousands of wedding photos, this saves time in post-processing.

Sports photographers use JPEG files to be able to send photos to their graphic editors during the event. In both cases, the speed, efficiency, and smaller file size of the JPEG format make it logical to use this file type.

Color depth on computer screens

Bit depth also refers to the color depth that computer monitors are capable of displaying. It may be hard for a reader using modern displays to believe this, but the computers I used in school could only reproduce 2 colors - white and black. The "must-have" computer of that time was the Commodore 64, capable of reproducing as many as 16 colors. According to information from Wikipedia, more than 12 units of this computer have been sold.


Commodore 64 computer. Photo by Bill Bertram

Surely you won't be able to edit photos on a machine with 16 colors (64KB of RAM won't support anymore anyway), and the invention of 24-bit displays with realistic color reproduction is one of the things that did digital photography possible. Displays with realistic color reproduction as JPEG files, are formed using three colors (red, green and blue), each with 256 shades, written in an 8-bit digit. Most modern monitors use either 24-bit or 32-bit graphics devices with realistic color reproduction.

HDR files

As many of you know, high dynamic range (HDR) images are created by combining multiple versions of the same image captured at different exposure settings. But did you know that the software generates a 32-bit image with over 4 billion tonal values ​​per channel per pixel - just a leap from the 256 tones in a JPEG file.

True HDR files cannot be displayed correctly on a computer monitor or printed page. Instead, they are truncated to 8 or 16-bit files using a process called tone-mapping, which preserves the characteristics of the original high dynamic range image but allows it to be reproduced on devices with a narrow dynamic range.

Conclusion

Pixels and bits are the basic building blocks for digital imaging. If you want to get the best image quality possible with your camera, you need to understand the concept of color depth and the reasons why RAW produces the best image quality.

Solving problems for encoding graphic information.

Raster graphics.

Vector graphics.

Introduction

This electronic manual contains a group of tasks on the topic "Coding of graphic information". The collection of tasks is divided into types of tasks based on the specified topic. Each type of tasks is considered taking into account a differentiated approach, ie, tasks of the minimum level (grade "3"), general level (grade "4"), advanced level (grade "5") are considered. The given tasks are taken from various textbooks (the list is attached). The solutions of all problems are considered in detail, guidelines are given for each type of problem, and a brief theoretical material is given. For ease of use, the manual contains links to bookmarks.

Raster graphics.

Types of tasks:

1. Finding the amount of video memory.

2. Determining the screen resolution and setting the graphics mode.

3.

1. Finding the amount of video memory

In tasks of this type, the following concepts are used:

· amount of video memory,

· graphic mode,

· color depth,

· screen resolution,

· palette.

In all such problems, it is required to find one or another value.

Video memory - this is a special random access memory in which a graphic image is formed. In other words, to get a picture on the monitor screen, it must be stored somewhere. That's what video memory is for. Most often, its size is from 512 KB to 4 MB for the best PCs with the implementation of 16.7 million colors.


Video memory size calculated by the formula: V =I *X *Y whereI- color depth of a single point, X,Y - dimensions of the screen horizontally and vertically (the product of x and y is the screen resolution).

The display screen can operate in two main modes: text and graphic.

V graphics mode the screen is divided into separate luminous points, the number of which depends on the type of display, for example 640 horizontally and 480 vertically. The luminous points on the screen are usually called pixels, their color and brightness may vary. It is in the graphic mode that all complex graphic images created by special programs that control the parameters of each pixel on the screen. Graphic modes are characterized by such indicators as:

- resolution(the number of dots with which the image is displayed on the screen) - typical currently resolution levels are 800 * 600 dots or 1024 * 768 dots. However, for monitors with a large diagonal, a resolution of 1152 * 864 dots can be used.

- color depth(the number of bits used to encode the color of the dot), for example 8, 16, 24, 32 bits. Each color can be considered as a possible point state, Then the number of colors displayed on the monitor screen can be calculated by the formula K=2 I, where K- the number of colors, I- color depth or bit depth.

In addition to the above knowledge, the student should have an idea of ​​the palette:

- palette(the number of colors that are used to reproduce the image), for example 4 colors, 16 colors, 256 colors, 256 shades of gray, 216 colors in a mode called High color or 224, 232 colors in True color mode.

The student should also know the relationship between units of measurement of information, be able to convert from small units to larger ones, KB and MB, use a regular calculator and Wise Calculator.

Level "3"

1. Determine the required amount of video memory for various graphics modes the monitor screen if the color depth per point is known. (2.76)

Screen mode

Color depth (bits per point)

Solution:

1. Total dots on the screen (resolution): 640 * 480 = 307200
2. The required amount of video memory V = 4 bits * 307200 = 1228800 bits = 153600 bytes = 150 Kbytes.
3. The required amount of video memory for other graphics modes is calculated in the same way. The student uses a calculator to make calculations to save time.

Answer:

Screen mode

Color depth (bits per point)

150 Kb

300 Kb

600 Kb

900 Kb

1.2 Mb

234 Kb

469 Kb

938 Kb

1.4 Mb

1.8 MB

384 Kb

768 Kb

1.5 Mb

2.25 Mb

640 Kb

1.25 Mb

2,5 Mb

3.75 Mb

2. Black and white (no grayscale) bitmap graphic has a size of 10 ´10 points. How much memory will this image take? (2.6 8 )

Solution:

1. Number of points -100

2. Since only 2 colors are black and white. then the color depth is = 2)

3. The amount of video memory is 100 * 1 = 100 bits

Problem 2.69 is solved in a similar way.

3. For storage bitmap size 128 x 128 pixels allocated 4 KB of memory. What is the maximum possible number of colors in the image palette. (EGE_2005, demo, level A). (See also problem 2.73 )

Solution:

1. Determine the number of points in the image. 128 * 128 = 16384 dots or pixels.

2. The amount of memory for an image of 4 KB is expressed in bits, since V = I * X * Y is calculated in bits. 4KB = 4 * 1024 = 4,096 bytes = 4096 * 8 bits = 32768 bits

3. Find the color depth I = V / (X * Y) = 32768: 16384 = 2

4. N = 2I, where N is the number of colors in the palette. N = 4

Answer: 4

4. How many bits of video memory is occupied by information about one pixel on a b / w screen (without halftones)? (, P. 143, example 1)

Solution:

If the image is B / W without halftones, then only two colors are used - black and white, that is, K = 2, 2i = 2, I = 1 bit per pixel.

Answer: 1 pixel

5. How much video memory is required to store four pages of an image if the bit depth is 24 and the display resolution is 800 x 600 pixels? (, No. 63)

Solution:

1. Let's find the amount of video memory for one page: 800 * 600 * 24 = bits = 1,440,000 bytes = 1406.25 KB ≈1, 37 MB

2.1.37 * 4 = 5.48 MB ≈5.5 MB for storing 4 pages.

Answer: 5.5 MB

Level "4"

6. Determine the amount of video memory of the computer, which is required to implement the graphics mode of the monitor High Color with a resolution of 1024 x 768 pixels and a palette of 65536 colors. (2.48)

If the student remembers that the High Color mode is 16 bits per point, then the amount of memory can be found by determining the number of points on the screen and multiplying by the color depth, that is, 16. Otherwise, the student can reason like this:

Solution:

1. Using the formula K = 2I, where K is the number of colors, I is the color depth, we determine the color depth. 2I = 65536

The color depth is: I = log = 16 bits (calculated using programsWiseCalculator)

2 .. The number of image points is equal to: 1024 × 768 =

3. The required amount of video memory is: 16 bits ´ = 12 bits = 1572864 bytes = 1536 KB = 1.5 MB ("1.2 MBytes. The answer is given in the workshop Ugrinovich)... We teach students, translating into other units, to divide by 1024, not 1000.

Answer: 1.5 MB

7. In the process of converting a raster graphic image the number of colors has decreased from 65536 to 16. How many times will the amount of memory occupied by it decrease? (2.70,)

Solution:

It takes 16 bits to encode 65536 different colors for each point. It only takes 4 bits to encode 16 colors. Consequently, the amount of memory used has decreased 16: 4 = 4 times.

Answer: 4 times

8. Is there enough video memory of 256 KB to operate the monitor in 640 mode ´ 480 and a palette of 16 colors? (2.77)

Solution:

1. Let's find out the amount of video memory that is required to operate the monitor in 640x480 mode and a palette of 16 colors. V = I * X * Y = 640 * 480 * 4 (24 = 16, color depth is 4),

V = 1228800 bits = 153600 bytes = 150 KB.

2. 150 < 256, значит памяти достаточно.

Answer: enough

9. Specify the minimum amount of memory (in kilobytes) sufficient to store any 256 x 256 pixel bitmap image, if the image is known to use a palette of 216 colors. The palette itself does not need to be stored.

1) 128

2) 512

3) 1024

4) 2048

(ЕГЭ_2005, level А)

Solution:

Let's find the minimum amount of memory required to store one pixel. The image uses a palette of 216 colors, therefore, one pixel can be associated with any of 216 possible color numbers in the palette. Therefore, the minimum amount of memory for one pixel will be equal to log2 216 = 16 bits. The minimum amount of memory sufficient to store the entire image will be 16 * 256 * 256 = 24 * 28 * 28 = 220 bits = 220: 23 = 217 bytes = 217: 210 = 27 KB = 128 KB, which corresponds to item number 1.

Answer: 1

10. Graphics modes with color depths of 8, 16. 24, 32 bits are used. Calculate the amount of video memory required to implement these color depths at different screen resolutions.

Note: the task ultimately comes down to solving problem number 1 (level "3", but the student himself needs to remember the standard screen modes.

11. How many seconds does a modem transmitting messages at 28800 bps take to transmit a 640 x 480 pixel color bitmap, assuming the color of each pixel is encoded in three bytes? (ЕГЭ_2005, level В)

Solution:

1. Determine the size of the image in bits:

3 bytes = 3 * 8 = 24 bits,

V = I * X * Y = 640 * 480 * 24 bits = 7372800 bits

2. Find the number of seconds to transfer the image: 7372800: 28800 = 256 seconds

Answer: 256.

12. How many seconds does a modem transmitting messages at 14,400 bps take to transmit an 800 x 600 pixel color bitmap, assuming there are 16 million colors in the palette? (ЕГЭ_2005, level В)

Solution:

16M colors require 3 bytes or 24 bits to encode (Graphics Mode True Color). The total number of pixels in the image is 800 x 600 = 480,000. Since there are 3 bytes per pixel, there are 480,000 * 3 = 1,440,000 bytes or bits per 480,000 pixels. : 14400 = 800 seconds.

Answer: 800 seconds.

13. Modern monitor allows you to get different colors on the screen. How many bits of memory does 1 pixel take? ( , p. 143, example 2)

Solution:

One pixel is encoded by a combination of two characters "0" and "1". We need to find out the length of the pixel code.

2x =, log2 = 24 bit

Answer: 24.

14. What is the minimum amount of memory (in bytes) sufficient to store a black-and-white raster image of 32 x 32 pixels, if it is known that the image uses no more than 16 shades of gray. (USE_2005, level A)

Solution:

1. The color depth is 4 because 16 color gradations are used.

2.32 * 32 * 4 = 4096 bits of memory for storing black and white images

3.4096: 8 = 512 bytes.

Answer: 512 bytes

Level "5"

15. The monitor operates with a 16 color palette in 640 * 400 pixel mode. It takes 1250 KB to encode the image. How many pages of video memory does it take? (Task 2, Test I-6)

Solution:

1.Since the page - a section of video memory that contains information about one screen image of one "picture" on the screen, that is, several pages can be placed in the video memory at the same time, then to find out the number of pages, you need to divide the video memory for the entire image by the memory size by 1 page. TO-number of pages, K =Vimage /V1 p

Vimage = 1250 KB by condition

1. To do this, let's calculate the amount of video memory for one page of an image with a 16 color palette and a resolution of 640 * 400.

V1 page = 640 * 400 * 4, where 4 is the color depth (24 = 16)

V1 page = 1024000 bits = 128000 bytes = 125 KB

3. K = 1250: 125 = 10 pages

Answer: 10 pages

16. The video memory page is 16000 bytes. The display operates in a mode of 320 * 400 pixels. How many colors are in the palette? (Task 3, Test I-6)

Solution:

1. V = I * X * Y - volume of one page, V = 16000 bytes = 128000 bits by condition. Find the color depth I.

I = 128000 / (320 * 400) = 1.

2. Now let's determine how many colors are in the palette. K =2 I, where K- the number of colors, I- color depth . K = 2

Answer: 2 colors.

17. A color image of size 10 is scanned ´10 cm. Scanner resolution 600 dpi and 32-bit color depth. How much information will the resulting graphic file have? (2.44, , Problem 2.81 is solved in a similar way. )

Solution:

1. A scanner's resolution of 600 dpi (dot per inch) means that the scanner can distinguish 600 dots over a 1-inch line. Let's translate the resolution of the scanner from dots per inch to dots per centimeter:

600 dpi: 2.54 "236 dots / cm (1 inch = 2.54 cm.)

2. Therefore, the size of the image in pixels will be 2360´2360 pixels. (multiplied by 10 cm.)

3. The total number of image points is:

4. The information volume of the file is:

32 bit ´ 5569600 = bit "21 MB

Answer: 21 MB

18. The amount of video memory is 256 Kb. The number of colors used is -16. Calculate the display resolution options. Provided that the number of image pages can be 1, 2 or 4. (, No. 64, p. 146)

Solution:

1. If the number of pages is 1, then the formula V = I * X * Y can be expressed as

256 * 1024 * 8 bits = X * Y * 4 bits, (since 16 colors are used, the color depth is 4 bits.)

i.e. 512 * 1024 = X * Y; 524288 = X * Y.

The ratio between the height and width of the screen for standard modes does not differ and is equal to 0.75. So, to find X and Y, you need to solve the system of equations:

We express X = 524288 / Y, substitute it into the second equation, we get Y2 = 524288 * 3/4 ​​= 393216. Find Y≈630; X = 524288 / 630≈830

630 x 830.

2. If the number of pages is 2, then one page with a volume of 256: 2 = 128 KB, i.e.

128 * 1024 * 8 bits = X * Y * 4 bits, i.e. 256 * 1024 = X * Y; 262144 = X * Y.

We solve the system of equations:

X = 262144 / Y; Y2 = 262144 * 3/4 ​​= 196608; Y = 440, X = 600

The resolution option can be 600 x 440.

4. If the number of pages is 4, then 256: 4 = 64; 64 * 1024 * 2 = X * Y; 131072 = X * Y; we solve the system and the screen dot size is 0.28 mm. (2.49)

Solution:

https://pandia.ru/text/78/350/images/image005_115.gif "width =" 180 "height =" 96 src = ">

1. The task is reduced to finding the number of points across the width of the screen. Let us express diagonal size in centimeters... Considering that 1 inch = 2.54 cm, we have: 2.54 cm 15 = 38.1 cm.

2. We define ratio between height and width of the screen Ana for the frequently occurring screen mode of 1024x768 pixels: 768: 1024 = 0.75.

3. We define screen width... Let the screen width be L, and the height h,

h: L = 0.75, then h = 0.75L.

By the Pythagorean theorem we have:

L2 + (0.75L) 2 = 38.12

1.5625 L2 = 1451.61

L ≈ 30.5 cm.

4. The number of dots along the width of the screen is:

305mm: 0.28mm = 1089.

Therefore, the maximum possible screen resolution of the monitor is 1024x768.

Answer: 1024x768.

26. Determine the ratio between the height and width of the monitor screen for different graphics modes. Does this ratio differ for different modes? a) 640x480; b) 800x600; c) 1024x768; a) 1152x864; a) 1280x1024. Determine the maximum possible screen resolution for a 17 "monitor with a screen dot size of 0.25 mm. (2.74 )

Solution:

1. Let's determine the ratio between the height and width of the screen for the listed modes, they hardly differ from each other:

2. Let's express the size of the diagonal in centimeters:

2.54 cm 17 = 43.18 cm.

3. Let's determine the width of the screen. Let the screen width be L, then the height is 0.75L (for the first four cases) and 0.8L for the last case.

By the Pythagorean theorem we have:

Therefore, the maximum possible screen resolution of the monitor is. 1280x1024

Answer: 1280x1024

3. Color and image encoding.

Students use the knowledge gained earlier in the Number System, the translation of numbers from one system to another.

The theoretical material of the topic is also used:

Color bitmap is rendered in accordance with color model RGB, in which the three base colors are Red, Green, and Blue. The intensity of each color is specified in an 8-bit binary code, which is often expressed in hexadecimal notation for convenience. In this case, the following recording format is used, RRGGBB.

Level "3"

27. Write down the red code in binary, hexadecimal and decimal notation. (2.51)

Solution:

The red color corresponds to the maximum value of the intensity of the red color and minimum values intensities of green and blue base colors , which corresponds to the following data:

Codes / Colors

Red

Green

Blue

binary

hexadecimal

decimal

28. How many colors will be used if 2 levels of brightness gradation are taken for each pixel color? 64 brightness levels of each color?

Solution:

1. In total, for each pixel, a set of three colors (red, green, blue) is used with its own brightness levels (0-on, 1-off). Hence, K = 23 = 8 colors.

Answer: 8; 262 144 colors.

Level "4"

29. Fill in the color table at 24-bit color depth in hexadecimal notation.

Solution:

With a color depth of 24 bits, 8 bits are allocated for each of the colors, that is, 256 intensity levels are possible for each of the colors (28 = 256). These levels are given in binary codes (minimum intensity, maximum intensity). In binary representation, the following shaping of colors is obtained:

Color name

Intensity

Red

Green

Blue

Black

Red

Green

Blue

White

Translated into the hexadecimal number system, we have:

Color name

Intensity

Red

Green

Blue

Black

Red

Green

Blue

White

30. On a "small monitor" with a 10 x 10 raster grid there is a black and white image of the letter "K". Represent the contents of video memory as a bit matrix, in which the rows and columns correspond to the rows and columns of the raster grid. ( , c. 143, example 4)

9 10

Solution:

To encode an image on such a screen, 100 bits (1 bit per pixel) of video memory is required. Let “1” denote a filled pixel, and “0” not a filled one. The matrix will look like this:

0001 0001 00

0001 001 000

0001 01 0000

00011 00000

0001 01 0000

0001 001 000

0001 0001 00

Experiments:

1. Search for pixels on the monitor.

Arm yourself with a magnifying glass and try to see the triads of red, green and blue (RGB - from English. "Red -Green -Blue ”dots on the monitor screen. (, .)

As the primary source warns us, the results of experiments will not always be successful. The reason is. What exist different technologies manufacture of cathode-ray tubes. If the tube is made according to the technology "Shadow mask", then you can see a real mosaic of dots. In other cases, when instead of a mask with holes, a filament system of phosphor of three primary colors is used (aperture grille), the picture will be completely different. The newspaper provides very graphic photographs of three typical pictures that "curious students" can see.

It would be useful for the children to inform that it is desirable to distinguish between the concepts of "screen point" and pixels. The concept of "screen points"- physically real objects. Pixels logical elements of the image. How can this be explained? Let's remember. That there are several typical configurations of the picture on the monitor screen: 640 x 480, 600 x 800 pixels and others. But on the same monitor, you can install any of them .. This means that the pixels are not the dots of the monitor. And each of them can be formed by several neighboring luminous points (in the limit of one). On the command to paint this or that pixel in blue, the computer, taking into account the set display mode, will paint over one or several adjacent points of the monitor. Pixel density is measured as the number of pixels per unit of length. The most common units are referred to for short as (dots per inch - the number of dots per inch, 1 inch = 2.54 cm). The dpi unit is generally accepted in the field computer graphics and publishing. Typically the pixel density for a screen image is 72 dpi or 96 dpi.

2. Experiment in graphic editor if for each color of a pixel 2 levels of brightness gradation are taken? What colors will you get? Draw up in the form of a table.

Solution:

Red

Green

Blue

Colour

Turquoise

Crimson

Vector graphics:

1. Vector image coding tasks.

2. Getting a vector image using vector commands

In the vector approach, the image is considered as a description of graphic primitives, lines, arcs, ellipses, rectangles, circles, shades, etc. The position and shape of these primitives in the graphic coordinate system are described.

Thus vector image encoded by vector commands, i.e. described using an algorithm. A segment of a straight line is determined by the coordinates of its ends, circle - center coordinates and radius, polygon- coordinates of its corners, shaded area- border line and fill color. It is advisable for students to have a vector graphics instruction set table (, p. 150):

Command

Action

Line to X1, Y1

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

Line X1, Y1, X2, Y2

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

Circle X, Y, R

Draw a circle; X, Y are center coordinates and R is radius length.

Ellipse X1, Y1, X2, Y2

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

Rectangle X1, Y1, X2, Y2

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

Paint Color Color

Set the current drawing color.

Fill color Color

Set the current fill color

Paint over X, Y, BORDER COLOR

Paint any closed figure; X, Y - coordinates of any point inside the closed shape, BORDER COLOR - color of the boundary line.

1. Tasks for coding a vector image.

Level "3"

1. Describe the letter "K" with a sequence of vector commands.

Literature:

1., Informatics for lawyers and economists, p. 35-36 (theoretical material)

2., Informatics and IT, pp. 112-116.

3. N. Ugrinovich, L. Bosova, N. Mikhailova, Workshop on Informatics and IT, pp. 69-73. (tasks 2.67-2.81)

4., Popular lectures about the device of the computer. - SPb., 2003, pp. 177-178.

5. In search of a pixel or types of cathode-ray tubes. // Informatics. 2002, 347, pp. 16-17.

6.I. Semakin, E Henner, Informatics. Workshop problem book, vol. 1, Moscow, LBZ, 1999, pp. 142-155.

Electronic textbooks:

1., Information in the school computer science course.

2., Reshebnik on the topic "Information Theory"

Tests:

1. Test I-6 (encoding and measurement of graphic information)

When ordering printing on packages, it is recommended to apply simple images for execution in no more than one to three colors. It is worth noting that when creating a layout by a good designer, this will not in any way affect the quality and perception of the advertising information by the consumer, and besides, it will reduce the cost and terms of order production. You should also take into account the possibility of color matching in terms of technology and choose the right equipment. After all, not all the applied images are geometrically independent of each other, often some colors are rigidly connected with each other and they need to be joined.

If you still need a drawing with a large number of different colors, then it is better to use special equipment that allows you to perform full color printing on packages... The principle of such machines is the presence of ultraviolet drying, since only UV-curable inks can be used for full color printing. Of course this technology implies not only the high cost of printing full-color images on the package, but also printing larger dots, so you should not expect the quality of the picture, as on paper.

Between the number of colors specified by the dot of the bitmap and the amount of information that needs to be allocated to store the color of a point, there is a dependence determined by the ratio (R. Hartley's formula):

where

I- amount of information

N the number of colors given to the point.

So, if the number of colors specified for the image point is N = 256, then the amount of information required to store it (color depth) in accordance with R. Hartley's formula will be equal to I= 8 bits.

Computers use various graphic display modes to display graphical information. It should be noted here that in addition to the graphic mode of the monitor, there is also a text mode, in which the monitor screen is conventionally divided into 25 lines of 80 characters per line. These graphics modes are characterized by the monitor screen resolution and color quality (color depth).

To implement each of the graphic modes of the monitor screen, a certain information volume of video memory computer (V), which is determined from the ratio

where

TO- the number of image points on the monitor screen (K = A · B)

A- the number of dots horizontally on the monitor screen

V- the number of dots vertically on the monitor screen

I- the amount of information (color depth), i.e. the number of bits per pixel.

So, if the monitor screen has a resolution of 1024 by 768 pixels and a palette of 65536 colors, then

color depth will be I = log 2 65 538 = 16 bits,

the number of pixels in the image will be K = 1024 x 768 = 786432

The required information volume of video memory in accordance will be equal to V = 786432 16 bits = 12582912 bits = 1572864 bytes = 1536 KB = 1.5 MB.

Files created on the basis of raster graphics assume the storage of data about each individual point in the image. To display raster graphics, complex mathematical calculations are not required, it is enough to just get data about each point of the image (its coordinates and color) and display them on the computer monitor screen.

Bit depth is one of the parameters everyone is chasing, but few photographers really understand it. Photoshop offers 8, 16 and 32 bit file formats. We sometimes see files marked as 24 and 48-bit. And our cameras often offer 12 and 14-bit files, although you can get 16-bit with a medium format camera. What does all this mean, and what really matters?

What is bit depth?

Before comparing the different options, let's first discuss what the name means. A bit is a computer unit of measure related to storing information in the form of 1 or 0. One bit can have only one of two values: 1 or 0, yes or no. If it were a pixel, it would be completely black or completely white. Not very helpful.

In order to describe a more complex color, we can combine several bits. Each time we add bits, the number of potential combinations doubles. One bit has 2 possible values ​​0 or 1. When combining 2 bits, you can have four possible values ​​(00, 01, 10 and 11). When you concatenate 3 bits, you can have eight possible values ​​(000, 001, 010, 011, 100, 101, 110, and 111). Etc. In general, the number possible options will be the number two raised to the power of the number of bits. Thus, "8-bit" = 2 8 = 256 possible integer values. In Photoshop, this is represented as integers 0-255 (internally, this is the binary code 00000000-11111111 for the computer).

This is how bit depth defines the smallest changes you can make over a range of values. If our grayscale from pure black to pure white has 4 values, which we get from a 2-bit color, then we will be able to use black, dark gray, light gray and white. This is quite small for photography. But if we have enough bits, we have enough wide grayscale steps to create what we will see as a perfectly smooth black to white gradient.

Below is an example of comparing a black and white gradient at different bit depths. This image is just an example. Click on it to see the full resolution JPEG2000 up to 14-bit. Depending on the quality of your monitor, you can probably only see differences up to 8 or 10 bits.

How to understand bit depth?

It would be convenient if all "bit depths" could be compared directly, but there are some differences in terminology that need to be understood.

Please note that the image above is black and white. A color image is usually composed of red, green, and blue pixels to create color. Each of these colors is treated as a "channel" by the computer and monitor. Software Photoshop and Lightroom, for example, count the number of bits per channel. So 8 bits means 8 bits per channel. This means that an 8-bit RGB image in Photoshop will have a total of 24 bits per pixel (8 for red, 8 for green, and 8 for blue). A 16-bit RGB image or LAB in Photoshop will be 48 bits per pixel, etc.

You might assume that 16-bit means 16-bit per channel in Photoshop, but it works differently in this case. Photoshop actually uses 16 bits per channel. However, it treats 16-bit snapshots differently. It just adds one bit to 15 bits. This is sometimes referred to as 15 + 1 bit. This means that instead of 2 16 possible values ​​(which would equal 65536 possible values) there are only 2 15 + 1 possible values, which is 32768 + 1 = 32769.

So, in terms of quality, it's fair to say that Adobe's 16-bit mode actually only contains 15-bits. You do not believe? Look at the 16-bit scale for the Info panel in Photoshop, which shows a scale of 0-32768 (which means 32769 values ​​given zero. Why does Adobe do this? According to a statement from Adobe developer Chris Cox, this allows Photoshop to run much faster and provides an accurate midpoint for range, which is useful for blending modes.

Most cameras will allow you to save files in 8-bit (JPG) or 12 to 16-bit (RAW). So why doesn't Photoshop open a 12 or 14 bit RAW file like 12 or 14 bit? On the one hand, this would require a lot of resources to Photoshop work and changing file formats to support different bit depths. And opening 12-bit files as 16-bit is really no different than opening an 8-bit JPG and then converting to 16-bit. There is no immediate visual difference. But most importantly, there are huge benefits to using a file format with a few extra bits (as we will discuss later).

For displays, the terminology changes. Manufacturers want the specs of their equipment to sound seductive. Therefore, 8-bit display modes are usually signed as "24-bit" (because you have 3 channels with 8-bit each). In other words, “24-bit” (“True Color”) for a monitor is not very impressive, it actually means the same as 8-bit for Photoshop. The best option would be "30-48 bits" (called "Deep Color"), which is 10-16 bits per channel, although for many more than 10 bits per channel is overkill.

How many bits can you see?

With a pure gradient (i.e. worst case conditions), many can find banding in a 9-bit gradient that contains 2048 grayscale on a good display with support for deeper color rendering. The 9-bit gradient is extremely faint, barely perceptible. If you didn’t know about its existence, you wouldn’t see it. And even when you look at it, it will not be easy to tell where the borders of each color are. The 8-bit gradient is relatively easy to see if you look closely at it, although you can still ignore it if you don't look closely. Thus, a 10-bit gradient can be said to be visually identical to a 14-bit or deeper gradient.

Note that if you want to create your own file in Photoshop, the gradient tool will create 8-bit gradients in 8-bit document mode, but even if you convert the document to 16-bit mode, you will still have 8-bit gradient. However, you can create a new gradient in 16-bit mode. However, it will be generated in 12-bit. The program does not have a 16-bit option for the gradient tool in Photoshop, but 12-bit is more than enough for anyone. practical work since it allows 4096 values.

Don't forget to turn on anti-aliasing in the gradient bar as this is best for testing.

It is also important to note that you are likely to encounter false banding when viewing images at less than 67% magnification.

Why use more bits than you can see?

Why do we have options, even more than 10-bit in our cameras and Photoshop? If we didn't edit the photos, then there would be no need to add more bits than the human eye can see. However, when we start editing photographs, previously hidden differences can easily be licked out.

If we significantly lighten shadows or darken highlights, then we will increase some of the dynamic range. And then any shortcomings will become more obvious. In other words, increasing the contrast in the image works like decreasing the bit depth. If we twist the parameters hard enough, banding may appear in some areas of the image. It will show the transitions between colors. Such moments are usually visible in clear blue skies or in the shadows.

Why do 8-bit images look the same as 16-bit images?

When converting a 16-bit image to 8-bit, you will not see the difference. If so, then why use 16-bit?

It's all about smooth editing. When working with curves or other tools, you will get more tonal and color correction steps. The transitions will be smoother in 16 bits. Therefore, even if the difference may not initially be noticeable, the transition to a lower color bit depth can become a serious problem later, when editing the image.

So how many bits do you really need in a camera?

Changing 4 stops to will provide a loss of just over 4 bits. Varying 3 stops is closer to losing 2 bits. How often do you have to adjust the exposure this much? When working with RAW, correction up to +/- 4 stops is an extreme and rare situation, but it does happen, so it is advisable to have an extra 4-5 bits above the visible range in order to have headroom. With a normal range of 9-10 bits, with a margin of norm it can be about 14-15 bits.

In fact, you will probably never need that much data for several reasons:

  • There are not many situations where you will come across a perfect gradient. Clear blue skies are probably the most common example. All other situations have a large number of detail and color transitions are not smooth, so you will not see a difference when using different bit depths.
  • The accuracy of your camera is not high enough to ensure accurate color reproduction. In other words, there is noise in the image. This noise usually makes it much more difficult to see the transitions between colors. It turns out that real images are usually not able to display color transitions in gradients, since the camera is not able to capture the ideal gradient that can be created programmatically.
  • You can remove color transitions during post-processing by using Gaussian blur and adding noise.
  • A large margin of beats is needed only for extreme tonal adjustments.

Taking all this into account, 12-bit sounds like a very reasonable level of detail that would allow for excellent post-processing. However, the camera and the human eye reacts differently to light. The human eye is more sensitive to shadows.

An interesting fact is that a lot depends on the program you are using for post-processing. For example, pulling shadows from the same image in Capture One (CO) and Lightroom can produce different results. In practice, it turned out that CO spoils deep shadows more than its analogue from Adobe. Thus, if you pull in LR, then you can count on 5 stops, and in CO - only 4.

Still, it is best to avoid trying to extend more than 3 stops of dynamic range due to noise and color cast. 12-bit is definitely a smart choice. If you care about quality, not file size, then shoot in 14-bit mode if your camera allows.

How many bits does it cost to use in Photoshop?

Based on the above, it should be clear that 8-bit is not enough. You can immediately see the color transitions in smooth gradients. And if you don't see it right away, even modest adjustments can make the effect noticeable.

It's worth working in 16-bit even if your original file is 8-bit, such as JPG images. The 16-bit mode will give the best results as it will minimize transitions when editing.

There is no point in using 32-bit mode if you are not processing the HDR file.

How many bits do you need for the internet?

The advantages of 16-bit are in the enhanced editing capabilities. Converting the final edited image to 8-bit is great for viewing snapshots and has the advantage of creating small files for the web for more fast loading... Make sure anti-aliasing is turned on in Photoshop. If you are using Lightroom to export to JPG, anti-aliasing is used automatically. This helps to add a bit of noise, which should minimize the risk of noticeable 8-bit color gradients.

How many bits do you need to print?

If you print at home, you can simply create a copy of the working 16-bit file and process it for printing, printing the working file. But what if you are submitting your images over the internet to a lab? Many will use 16-bit TIF files, which is a great way. However, if a JPG is required for printing, or if you want to send a smaller file, you may encounter questions about converting to 8-bit.

If your print lab accepts 16-bit format (TIFF, PSD, JPEG2000), just ask the experts which files are preferable.

If you need to send a JPG, it will be 8 bits, but that shouldn't be a problem. In fact, 8-bit is great for final printing. Just export files from Lightroom with 90% quality and color space Adobe RGB... Do all the processing before converting the file to 8 bits and there will be no problem.

If you don't see banding on your monitor after converting to 8-bit, you can be sure everything is okay for printing.

What is the difference between bit depth and color space?

The bit depth determines the number of possible values. The color space defines the maximum values ​​or range (commonly known as "gamma"). If you need to use a box of crayons as an example, a large bit depth would be expressed in more shades, and a larger range will be expressed as more saturated colors regardless of the number of pencils.

To see the difference, consider the following simplified visual example:

As you can see by increasing bit depth we reduce the risk of color transition streaks. By expanding the color space (wider gamut) we can use more extreme colors.

How does color space affect bit depth?


SRGB (left) and Adobe RGB (right)

The color space is the range in which the bits are applied, so a very large gamut could theoretically cause banding associated with color transitions if stretched too much. Remember that bits determine the number of transitions in relation to the color range. Thus, the risk of visually noticeable transitions increases as the gamut expands.

Recommended settings to avoid banding

After all this discussion, you can draw a conclusion in the form of recommendations to follow in order to avoid problems with color transitions in gradients.

Camera settings:

  • 14+ bit RAW file is good choice, if you want to, best quality especially if you are counting on hue and brightness adjustments, such as increasing the brightness in the shadows by 3-4 stops.
  • A 12-bit RAW file is great if you want less file size or shoot faster. For a Nikon D850 camera, a 14-bit RAW file is about 30% larger than a 12-bit file, so this is important factor... AND large files may affect the ability to capture long series of frames without overflowing the memory buffer.
  • Never shoot JPG if you can. If you are shooting some kind of events when you need to quickly transfer files and the quality of the images does not matter, then of course Jpeg will be an excellent option. You may also want to consider shooting in JPG + RAW mode if you need a better quality file later. It's worth sticking to the SRGB color space if you're shooting in JPG. If you're shooting RAW, you can ignore the color space settings. RAW files do not actually have a color space. It is not installed until the conversion is performed. RAW file to a different format.

Lightroom and Photoshop (working files):

  • Always save your working files in 16-bit. Use 8-bit only for final export in JPG format for web and print, if this format meets the requirements of the printing equipment. It is okay to use 8-bit for final output, but this mode should be avoided during processing.
  • Be sure to view the photo at 67% or larger to ensure there are no noticeable color transitions in the gradients. At a smaller scale, Photoshop can create false banding. This will be our other article.
  • Be careful when using HSL in Lightroom and Adobe camera RAW, as this tool can create color stripes. This has very little to do with bit depth, but problems are possible.
  • If your original file is only available in 8-bit (eg JPG), you should immediately convert it to 16-bit before editing. Subsequent edits to 8-bit images in 16-bit mode will not create too obvious problems.
  • Don't use 32-bit space unless you're using it to combine multiple RAW (HDR) files. There are some limitations when working in 32-bit space, and files become twice as large. Your best bet is to do HDR blending in Lightroom instead of using 32-bit in Photoshop.
  • Lightroom's HDR DNG format is very handy. It uses 16-bit floating point mode in order to cover a wider dynamic range with the same number of bits. Counting on the fact that we usually only need to correct the dynamic range in HDR within 1-2 stops, this is an acceptable format that improves quality without creating huge files. Of course, don't forget to export this RAW in 16-bit TIF / PSD when you need to continue editing in Photoshop.
  • If you are one of the few people who have to use 8-bit for some reason, it is probably best to stick with the sRGB color space.
  • When using the gradient tool in Photoshop, checking the "anti-aliasing" option, the program will use 1 extra bit... This can be useful when working in 8-bit files.

Export for internet:

  • JPG with 8 bits and sRGB color space is ideal for the web. While some monitors are capable of displaying higher bit depths, the increased file size is probably not worth it. And while more and more monitors support wider gamuts, not all browsers support color management correctly and may display images incorrectly. And most of these new monitors probably never went through color calibration.
  • 8-bit is fine for final print output, but use 16-bit if your printing hardware supports it.
  • A standard monitor is fine for most tasks, but remember that you may see color gradients due to 8-bit displays. These streaks may not actually be in the pictures. They appear at the stage of displaying on the monitor. The same image may look better on a different display.
  • If you can afford it, the 10-bit display is ideal for photography. A wide range such as Adobe RGB is also ideal. But this is optional. You can create stunning pictures on the most ordinary monitor.

A look into the future

V this moment choosing a higher bit depth may not matter to you since your monitor and printer can only operate at 8 bits, but this may change in the future. Your new monitor will be able to display more colors, and you can print on professional equipment. Save your work files in 16-bit. This will be enough to keep the best quality for the future. This will be enough to meet the requirements of all monitors and printers that will appear in the foreseeable future. This range of color is enough to go beyond the range of human vision.

However, gamma is different. Chances are you have a monitor with an sRGB color gamut. If it supports the wider Adobe RGB or P3 gamut, then you're better off working with those gamuts. Adobe RGB has a wider range of colors in blues, cyan and greens, while P3 offers broader colors in reds, yellows and greens. In addition to P3 monitors, there are commercial printers that exceed the AdobeRGB gamut. sRGB and AdobeRGB are no longer able to capture the full range of colors that can be reproduced on a monitor or printer. For this reason, it is worth using a wider color range if you expect to print or view your images on better printers and monitors later. The ProPhoto RGB gamma is suitable for this. And, as discussed above, a wider gamut needs a higher 16-bit bit depth.

How to remove banding

But if you encounter banding (most likely when converting to an 8-bit image, you can take the following steps to minimize this problem:

  • Convert the layer to a smart object.
  • Add Gaussian Blur. Set the radius to hide the banding. A radius equal to the width of the banding in pixels is ideal.
  • Use a mask to apply blur only where needed.
  • Finally, add some noise. The graininess removes the appearance of smooth blur and makes the image more coherent. If you are using Photoshop CC use the filter Camera RAW to add noise.