An In-Depth Look at Bit Depth

An In-Depth Look at Bit Depth

The bit depth of a camera defines the number of distinct shades that are available for each pixel. Many imaging applications don’t require a bit depth of more than 8 bits, however when color accuracy is needed, high bit depth is key in detecting the slightest deviation from specific color tones. For instance, as outlined in this Lumenera case study on paint inspection applications, when inspecting paint in automotive assembly lines, high bit depth allows the industrial camera to perform the analysis with greater accuracy. (Pictured Left: Bit depth chart. Click here for larger image.)

Bit depth comes from the binary nature of data, as it is stored electronically. Each bit can have one of two values: either a zero or a one. Each additional bit unlocks double the data, as it is an exponential relationship. The number of available shades per pixel can be calculated by taking two to the power of the bit depth.

The simplest example of bit depth is taking an image represented at a bit depth of one. A perfect example of this is black text on a white background. This is obviously too little data to represent more complex images with various color shades. Because of this, most images and computer monitors are comprised of images with a bit depth of 8 bits per color channel or 24 bits in total. This means that the image consists of 16,777,216 or 2(8x3) colors. While this is an acceptable amount of color for day-to-day images, systems with higher bit depths are recommended when accurate color analysis is required.

When cameras capture data at 12 and 14 bits per channel, they can evaluate much finer differences between color shades as they are able to differentiate between over 68 billion (68,719,476,736) colors for 12-bit and 4 trillion (4,398,046,511,104) colors for 14-bit cameras.

This is achieved by sampling each pixel with finer granularity. The pixel does not capture more light; it simply has a much wider range of values to associate to it. An analogy that is often used to describe a pixel is a bucket of water. You equate capturing light to filling the bucket. When it comes to bit depth, the analogy can continue by means of measuring the water. You could use a simple measuring cup which would work in most situations or you could use a graduated cylinder to achieve much higher accuracy in quantifying the amount of water. The quantity of water remains unchanged, but you have a much better idea of how much water you have.

water in measuring glass and cylinders for comparison

It is also important to note that most displays will not display images that are greater than 8 bits, as they are not designed to do so. Rather the image would need to be converted from a higher bit depth down to 8 bits. In this case, the original data of finer granularity would be grouped together into coarser color tones, losing the benefits of the camera’s high bit depth. Monitors that display images at higher bit depths are available and recommended for high performance imaging applications.

Image format and compression algorithms can also impact the bit depth as well as other aspects of image data, sometimes in an unrecoverable manner. Compression algorithms can be used to reduce the size of an image to increase transmission rates or decrease the space required to store them. These algorithms often target aspects of the image that are not easily perceivable to the human eye. For machine vision systems, this can be detrimental to their operation as significant data, including bit depth, can be lost. It is therefore imperative to ensure that raw data transmission and storage is used to guarantee there is no loss of data. Using a USB 3.0 camera and cable will ensure enough bandwidth to transmit raw images at a high bit depth without impacting the frame rate.

If you are unsure about the bit depth required by your system, you are invited to get in touch with the imaging experts at Lumenera, who will help you select a camera that is suitable for your specific application.