Colour depth, colour mapping, palette tables and direct colour:

Gap-fill exercise

Fill in all the gaps, then press "Check" to check your answers. Use the "Hint" button to get a free letter if an answer is giving you trouble. Note that you will lose points if you ask for hints!

Colour Depth

Colour depth describes the number of of memory that are used to store the colour information about each in a bitmap image.

With 1 bit colour depth the number of bits used to store the information about each is . This allows colours, represented by 0 or 1.
With 2 bit colour depth the number of used to store the information about each pixel is 2. This allows colours, represented by the binary codes 00, 01, 10 or
With 3 bit colour depth the number of bits used to store the information about each pixel is . This allows colours, represented by the binary codes 000, 001, 010, 011, , 101, 110 or 111.
meta_original_small.gifThe number of colours in this GIF image suggest that it is using bit colour depth.
SUMMARY: The greater the colour depth of a bitmap image, the greater the size because more memory is used to store the data about each pixel.

Colour mapping, palette tables and Direct colour:

Colour mapping - With low colour depths (up to 8 bit) it is practical to map every colour to a code because there are not too many colours involved. This is called colour mapping and an example might be the binary code 110 representing yellow.
Palette tables - The GIF file format uses 8 bits to store the colour data so each pixel can have different colours. However, every GIF image can have a different set of 256 colours because the set that is used is stored as part of the file in a table. This table stores the 256 colours using 24 bit direct colour giving 16,777,216 possible colours. Each of the 256 colours in the palette is indexed using bits so it is the 8 bit value that is actually stored for each pixel in a GIF file.
Direct colour - As the colour depth increases, colour mapping and palettes become impractical due to the number of possible that the image can display. In higher colour depths (8 bit and above) a system called colour is used instead. In this the bits allocated to each pixel seperatly encode the relative proportions of Red, Green and to specify what is called an RGB colour.
For example, if 24 bit direct colour was used then the code for a yellow pixel (maximum red and green and zero ) would be;
- 255 0 in denary
- 11111111 11111111 00000000 in (note the use of 24 bits)
- FF FF 00 in