Images
Colour depth (also called bit depth) is the number of bits used to store the colour of each pixel. It is not the same as resolution: resolution is about how many pixels make up the image, while colour depth is about how many bits store each pixel's colour.
The number of different colours that can be represented is 2 to the power of the colour depth (2^n). With n bits you can make 2^n different binary patterns, and each pattern is used for one colour. Each extra bit doubles the number of colours, because every existing pattern can have a 0 or a 1 added to it. For example, a 5-bit image can use 2^5 = 32 colours, and a 6-bit image can use 64.
| Colour depth (bits per pixel) | Calculation | Colours available |
|---|---|---|
| 5 | 2^5 | 32 |
| 6 | 2^6 | 64 |
| 7 | 2^7 | 128 |
Higher colour depth gives more colours, so a photo can show subtle shades and look more realistic, but each pixel needs more bits, so the file is larger. A lower colour depth makes a smaller file but gives fewer colours, so each colour may be approximated to the nearest one available. This makes the image less accurate: smooth shading can break into visible bands as one shade jumps straight to the next.
Edexcel GCSE Computer Science · Images