The bit depth or color depth of a digital image is the number of binary bits (bits) used to encode the color of a single pixel.
It is necessary to distinguish between the terms bit per channel (bpc – bits per channel) and bit per pixel (bpp – bits per pixel). The bit depth for each of the individual color channels is measured in bits per channel, while the sum of the bits of all channels is expressed in bits per pixel. For example, an image in the Truecolor palette has a resolution of 8 bits per channel, which is equivalent to 24 bits per pixel, because the color of each pixel is described by three color channels: red, green and blue (RGB model).
For an image encoded in a RAW file, the number of bits per channel matches the number of bits per pixel, since prior to interpolation, each pixel obtained using a matrix with an array of Bayer color filters contains information about only one of the three primary colors.
In digital photography, it is customary to describe bit depth mainly using bits per channel, and therefore, speaking of bit depth, I will mean only bits per channel, unless otherwise indicated.
Bit depth determines the maximum number of shades that may be present in the color palette of a given image. For example, an 8-bit black and white image can contain up to 28 = 256 shades of gray. A color 8-bit image can contain 256 gradations for each of the three channels (RGB), i.e. total 28×3 = 16777216 unique combinations or color shades.
High bit depth is especially important for the correct display of smooth tonal or color transitions. Any gradient in a digital image is not a continuous change in tone, but is a stepwise sequence of discrete color values. A large number of gradations creates the illusion of a smooth transition. If there are too few halftones, the gradation is visible with the naked eye and the image loses its realism. The effect of the appearance of visually distinguishable color jumps in areas of the image that originally contain smooth gradients is called posterization (from the English poster – poster), because a photo that lacks half-tones becomes like a poster printed using a limited number of inks.
Bitness in real life
To clearly illustrate the above material, I will take one of my Carpathian landscapes and show you how it would look at different depths. Remember that increasing bit depth by 1 bit means doubling the number of shades in the image palette.
1 bit – 2 shades.
1 bit allows you to encode just two colors. In our case, it is black and white.
2 bits – 4 shades.
With the advent of halftones, the image ceases to be just a set of silhouettes, but still looks pretty abstract.
3 bits – 8 shades.
The foreground details are already distinguishable. Striped skies are a good example of posterization.
4 bits – 16 shades.
Details begin to appear on the slopes of the mountains. In the foreground, posterization is almost invisible, but the sky remains striped.
5 bits – 32 shades.
Obviously, areas with low contrast, the display of which requires a large number of close halftones, are most affected by posterization.
6 bits – 64 shades.
The mountains are almost in order, but the sky still looks stepwise, especially closer to the corners of the frame.
7 bits – 128 shades.
I have nothing to complain about – all the gradients look smooth.
8 bits – 256 shades.
And here you have the original 8-bit photo. 8 bits is enough for a realistic transmission of any tonal transitions. On most monitors, you will not notice the difference between 7 and 8 bits, so even 8 bits may seem redundant. But still, the standard for high-quality digital images is exactly 8 bits per channel, with a guaranteed margin to block the ability of the human eye to distinguish color gradations.
But if 8 bits is enough for realistic color reproduction, then why might you need more than 8 bits? And where does all this noise about the need to save photos with a bit depth of 16 bits come from? The fact is that 8 bits is enough for storing and displaying a photograph, but not for processing it.
When editing a digital image, the tonal ranges can either be compressed or stretched, as a result of which part of the values are constantly discarded or rounded, and ultimately the number of halftones can fall below the level that is necessary for smooth transmission of tonal transitions. Visually, this is manifested in the appearance of the same posterization and other cutting artifact eyes. For example, brightening the shadows by two steps leads to a fourfold extension of the brightness range, which means that the edited sections of the 8-bit photo will look as if they were taken from a 6-bit image, where the gradation is very noticeable. Now imagine that we are working with a 16-bit image. 16 bits per channel means 216 = 65535 color gradations.