We are going to break the subject down into three parts, with a separate post for each:
Part 1: the basics–what is a bit? and how do bits relate to images?
Part 2: Bit range settings on cameras–what is gained or lost when using them?
Part 3: Getting the most out of 10- and 12-bit images
Bit Depth Basics
A bit is a digit in the binary (base 2) numeral system. In this blog we will be talking about binary numbers with from one to eight digits.
We are most accustomed to the decimal (base 10) numeral system. In base 10, each digit has ten possible values: 0-9. An eight-digit number has 100 million possible values from 0 to 99,999,999.
We use commas to break large decimal numbers into three-digit groups to separate the thousands, millions, billions, etc., making them easier to read.
In the binary numeral system, each digit is referred to as a bit. Each bit has two possible values: 0 and 1. An eight bit number has 256 values from 0000 0000 to 1111 1111.
We use spaces to break up large binary numbers into four-bit groups called nibbles. Two nibbles equal one byte.
1-bit image gives you 2 (21) values:
In a 1-bit imaging system, every pixel has a value of either 0 or 1. Pixels with a value of 0 are black. Pixels with a value of 1 are white.
2-bit (mono) images have 4 (22) values:
In a 2-bit (mono-we will touch on color a little later) imaging system there are 4 shades to work with.
3-bit (mono) images have 8 (23) values:
You can see that with each bit there is a doubling of the number of shades in the image. With 8 shades of gray, the bird is beginning to look more natural.
8-bit (mono) images have 256 (28) values:
8 bits is the maximum bit-depth for most digital displays and is the default bit depth for most mono image files. With 8 bits (1 byte) per pixel, there are more than enough shades for excellent images with subtle gradients.
Color Images
All of the images we have looked at so far have been grayscale. We have stated that the maximum bit-depth for most digital displays is 8 bits, which yields 256 shades of gray. You are probably wondering, what about color? Aren’t color images 24 bits?
While there have been earlier technologies with 256 or even fewer total colors, today, when a color camera or display specification calls out 8-bit color, it most often means 8 bits per RGB color. So you end up with (8 bits Red) x (8 bits Green) x (8 bits Blue)= 2563= 16,777,216 colors.
On camera sensors, each pixel has only only one color, Red, Green, or Blue. Most sensors use a Bayer filter mosaic alternating green/red columns with blue/green columns, resulting in a pattern with 25% Red, 50% Green, and 25% Blue pixels. This filter is created by physically applying Red, Green, and Blue, pigments directly onto the pixels.
After an image is captured, a “demosaicing” algorithm is applied to the image, that assigns a Red, Green, and Blue value to every pixel through interpolation of values of the neighboring pixels. Unless there is compression of some type also applied, the size of the image file will grow 3x.