Images

Images can be stored in different ways on a computer. When you create a drawing in PowerPoint this is a vector graphic. It is made up of lines with specific properties such as line style, line colour, where it starts and where it ends. The computer stores all of this data about each line in binary. When you take a photograph on a digital camera it is not made up of lines. The picture somehow has to capture the continuously changing set of colours and shades that make up the real-life view. To store this type of image on a computer the image is broken down into very small elements called pixels. A pixel (short for picture element) is one specific colour. The whole image may be 600 pixels wide by 400 pixels deep (just an example).

600 x 400 is referred to as the picture’s resolution. If the resolution of a picture is increased, then more pixels will need to be stored. This increases the size of the image file.

This image of a flower uses four colours. Therefore two bits are needed to store (record) the colour of each pixel:


The number of bits used to store each pixel dictates how many colours an image can contain. 8 bits per pixel will give 256 possible colours. The number of bits per pixel is referred to as the colour depth. To work out the minimum required colour depth from the number of colours in the image, convert the number of colours to a power of 2.

For up to:

2 = 21 colours 1 bit is required per pixel
4 = 22 colours 2 bits are required per pixel
8 = 23 colours 3 bits are required per pixel
16 = 24colours 4 bits are required per pixel
32 = 25colours 5 bits are required per pixel
64 = 26colours 6 bits are required per pixel
128 = 27colours 7 bits are required per pixel
256 = 28colours 8 bits are required per pixel
65,536 = 216colours 16 bits are required per pixel
16,777,216= 224colours 24 bits are required per pixel

If the colour depth is increased so more bits are used to represent each pixel, then the overall size of the image file will increase.

If we record the value of each pixel in this image, starting from the top left hand corner and going left to right across each row, we end up with the following data file:


10

10

10

10

10

10

10

10

10

00

10

00

10

00

10

10

10

10

00

00

00

10

10

10

10

00

00

01

00

00

10

10

10

10

00

00

00

00

10

10

10

00

10

00

11

00

10

10

10

10

10

10

11

10

10

10

10

10

10

10

10

11

10

10

10

11

11

11

10

11

11

10

10

10

11

11

11

11

10

10

10

10

10

10

11

10

10

10


A larger more colourful image would create an extremely larger data file.