Bits / Bit depth / bit depth per channel / bit depth per pixel / histogram / tonal range / dynamic range
After having read this article you have answer to the following questions:
What does bit mean? What is bit depth in photography? What does bit per channel mean? What does bit per pixel mean? What is the different between “bit per channel” and “bit per pixel”? What is tonal range? What is histogram? Is there a standard shape for histogram? What does dynamic range mean?
Bit, bit depth, tonal range, histogram and dynamic range are technical and seemingly difficult concepts to understand. However, they form a basis for better understanding of other photography concepts such as image format, image sensor etc. Hence, it is essential for a digital photographer to have a good understanding of them. In this article I will explain these terms as simple as possible.
Bit and bit depth:
In computer science, “bit” is the unit of information and can be “one” or “zero”. In photography, “1” bit means two colours or two possibilities for the light intensity. In an imaginary “1” bit image, each pixel has only two possibilities, for instance black and white. How? Let’s say during the exposure each pixel on the camera sensor receives different numbers of light photons, and accordingly will generate electronic signals. The camera’s computer will analyse these signals and will assign white colour to all pixels that have received a certain amount of light photons above a threshold, no matter how much. Other pixels that have received less light will be translated as black, again no matter whether the amount of light was slightly below the threshold or substantially below that. You can appreciate how unfair and unrealistic this scenario is. Nevertheless, these two possibilities (black and white) form the “Bit Depth” of this image and it is calculated by 2 powered by X (2X), in which X is the “bit number”. This scenario has been depicted in figure 1. There, we have 24 pixels, in which “11” pixels are white and “13” pixels are black. If we put this information on a diagram, then we have a simple “histogram”. Basically a histogram shows how many pixels in an image have the same light intensity / colour.
Figure 1. An imaginary “1” bit scenario, in which each pixel can only be black or white. A histogram shows the number of pixels that have the same light intensity / colours.
Now imagine, we have a more advanced camera but the camera sensor can only measure the intensity of light at each pixel -basically this camera’s sensor consists of only a pixel array- and the camera can generate 8 bits images. 8 bits means 28, or 256 possibilities (bit depth). In other words, pixels can have 256 different shades of grey, which forms also the “tonal range” of the image.
Figure 2. In an 8 bits grayscale image, pixels may have 256 different shades of grey. For the sake of simplicity only a few pixels, with 7 different shades of grey are shown here. The histogram in the same way is a representation of the number or pixels with the same light intensity.
Next, we add a colour filter array (Bayer filter) on the top of the pixel array and our sensor is able to provide information about Red, Green and Blue colours. As you remember from my previous post, 50% of pixels will have green filter, 25% red and 25% blue. Each colour forms a channel, because pixels with this colour filter will only and only measure the intensity of light for that colour. Hence, each channel can generate an 8 bits image with 256 possibilities (intensities of that colour) for only green or red or blue. This is also called “bit per channel”. Since we have 3 channels and during the colour reconstruction information from all 3 channels will be used to approximate the true colour of light at each pixel, then we will have 256x256x256 or 16,777,216 unique colour possibilities for each pixel, which is called “bit per pixel”. However, this does not mean that every single 8 bits image you make, shall contain all these colours. For instance if you make an image of a yellow cardboard, most of the colours of these 16,777,216 colours won’t be used.
Bit depth and dynamic range
If the scene you are photographing would contain colours / brightness that are covered by an 8 bit image, then you will have no problem at all. But imagine you are shooting with a wide angle lens at sunrise where the intensity of light changes fast from one corner of the lens to another one. This is a situation called “high dynamic range” in which the difference between brightest and darkest areas in the scene is very large. In addition the tonal range is very wide and changes very fast from one part of the image to another one. In this scenario the chance is almost real that some levels of light intensity would fall out of the scope of an 8 bit image. As a result you will see a phenomenon called “banding” in your images. Banding is simply caused because the bit depth does not match the tonal range of the scene and can not guarantee a seamless transition from one level of brightness to another one. Hence, there will be a “jump” instead of a smooth move from one to another next possible option, which results in “banding” effect as depicted in Figure 3.
Figure 3. Notice the banding effect in the upper 1/3 of the image and in particular in the upper right corner. This JPEG image is made with a NIKON D850.
In digital photography, we generally save our images -at the time of shooting- in JPEG or Raw. JPEG images are 8 bits (per channel) images. Raw images may have up to 16 bits per channel. This means a bit depth of 2 powered by 16 (216) or 65536 per channel and 281 trillion colours per pixel! Hence, simply said, a Raw image can cope much better with a high dynamic range scene and the chance of banding will be decreased substantially.
In a high dynamic range scene depicted figure 3 and 4, the real tonal range of the scene is extremely wide. A 16 bits per channel Raw image will better handle this and the pixels can have a wide range of light intensities to cope with this scenario. A histogram is in this situation a very useful tool, at least for educational purpose. Notice how the tonal range of the raw image spread over a wide range of shadow, mid-tones and highlights areas. When the same image is saved as a JPEG the situation will change. This results in a narrower tonal range. Many pixels that should have been spread over a wider range of shadow, mid-tones and highlights, have to take similar tones.
Figure 4. A Raw image has a much wider tonal range and can cope better with a high dynamic range scene. This is obvious from a much wider tonal range in the histogram and the absence of banding effect in the image. In contrast, the tonal range of the JPEG is much narrower and will fail in this situation. Keep in mind what a histogram represents. Having this mind, compare the width of the highlight and shadow areas in the histograms of both images. Images are made with a Nikon D850, the only viable is the image format. For the sake of simplicity images are turned to black and white afterwards.
Is there a normal shape for histogram?
There is absolutely no normal shape for histogram. Histogram basically shows how many pixels in an image have the same value of light intensity /colour and nothing more. Histogram is a very useful, in particular, for educational purposes. Using histogram at the time of shooting is not common, but will not add anything to what you see with your own eyes. We will get more into this later on when I explain how the camera’s light meter works.
I hope this was useful. Should you have any comment or question, please feel free to send me an email.
Triangle Photo Academy