GCSE Revision

Images

Pixels

A bitmap image is a grid of tiny squares called pixels (short for picture elements). Each pixel is one colour, and that colour is stored as a binary code.

In a black-and-white image, each pixel needs just 1 bit: say 1 for black and 0 for white. This 5 × 5 image of the letter T is stored row by row:

11111
00100
00100
00100
00100

The computer reads the codes back in order to rebuild the picture.

Key terms

Colour depth and resolution

Colour depth is the number of bits per pixel. With n bits, each pixel can be one of 2ⁿ colours:

Colour depthNumber of colours
1 bit2
8 bits256
24 bits16,777,216 (about 16.7 million)

Resolution is the number of pixels in the image, given as width × height, such as 1,920 × 1,080.

Increase the...Effect on qualityEffect on file size
Colour depthMore colours, so more realistic colours and smoother shadingBigger
ResolutionMore pixels, so more detail; less blocky (pixelated) when enlargedBigger

Key terms

Metadata

An image file also stores metadata: data about the image. It includes its width, height and colour depth, which the computer needs to rebuild the image: without the width, it wouldn't know where each row of pixels ends.

Metadata can also include the date the photo was taken, the camera used, and the location. Metadata makes the file a little bigger.

Key terms

Image file size

image file size = colour depth × image height (px) × image width (px)

The answer is in bits.

Example: an image is 200 pixels wide and 100 pixels high, with a colour depth of 8 bits. How big is the file in kilobytes?

  1. 8 × 100 × 200 = 160,000 bits
  2. Bits to bytes: 160,000 ÷ 8 = 20,000 bytes
  3. Bytes to KB: 20,000 ÷ 1,000 = 20 KB

With a colour depth of 16 bits, the file would be twice as big: 40 KB.

Exam tip

The formula gives bits. Read the question carefully for the unit it wants, and convert at the end.

Take the quiz