# Bits

In computer terms, a "bit" (binary digit) is the smallest piece of information and has a value of either "0" or "1" which actually corresponds to one of the millions of "switches" inside the computer being "ON" or "OFF".

In a 1 bit image we can assign the binary value "0" to black and "1" to white.

A 2bit image can have 2^2 = 4 tones: 00 (black), 01 (gray), 10 (gray), and 11 (white).

An 8bit image can have 2^8 = 256 tones ranging from 00000000 (0) to 11111111 (255).

JPEG images are often referred to as 24 bit images because they can store up to 8 bits in each of the 3 color channels and therefore allow for 256 x 256 x 256 = 16.7 million colors.

## 32 bit Floating Point Format (for advanced users)

In the topic about sensor linearity we saw that the upper half of the tones is used to describe the brightest stop. As a consequence, even a 16 bit INTEGER image only has 16 tones to describe the darkest stop in a 12 stop image, while for the brightest stop, 32,768 tones are available. This is the opposite of human vision which is more sensitive to shadow detail than to highlight detail. A 32 bit INTEGER image provides more tones but has the same limitation of having a disproportionate amount of tones for the highlights. 32 bit FLOATING POINT images address this issue by making more efficient use of the 32 bits. Instead of using 32 bits to describe 4,294,967,296 integer numbers, 23 bits are allocated to a fraction, 8 bits to an exponent, and 1 bit to a sign, as follows:

V = (-1)^S * 1.F * 2 ^ (E-127), whereby:
S= Sign, uses 1 bit and can have 2 possible values
F= Fraction, uses 23 bits and can have 8,388,608 possible values
E= Exponent, uses 8 bits and can have 256 possible values

Practically speaking, this allows for an almost infinite number of tones between level "0" and "1", more than 8 million tones between level "1" and "2" and 128 tones between level "65,534" and "65,535", much more in line with our human vision than a 32 bit integer image[1]. Because of the infinitesimally small numbers that can be stored, the 32 bit floating point format allows to store a virtually unlimited dynamic range. In other words, 32 bit floating point images can store a virtually unlimited dynamic range in a relatively compact way with more detail in the shadows than in the highlights and take up only twice the size of 16 bits per channel images, saving memory and processing power. A higher accuracy format allows for smoother dynamic and tonal range compression. This format is important in the computer graphics industry (gaming and animation) and supported by Adobe Photoshop CS2.

### Technical Footnote

1. (1) Which would have the same number of tones (65,536) between level "0" & "1", level "1" &"2", and level "65,534" &"65,535"