Book an info sessionInfo session

Representing images: pixels, resolution, colour depth

Cambridge IGCSE Computer Science (0478) · lesson 6 of 35 · 25 min

How Computers Store Images

A digital image is made up of a grid of tiny squares called pixels (picture elements). Each pixel stores a colour value as a binary number. The way these values are stored depends on three key properties: resolution, colour depth, and file size.

Resolution

Resolution is the number of pixels in an image, usually expressed as width × height (e.g. 1920 × 1080) or as pixels per inch (PPI/DPI). Higher resolution means more pixels, more detail, and a larger file size.

  • A 100 × 100 image has 10,000 pixels.
  • A 1920 × 1080 image has 2,073,600 pixels (≈ 2 megapixels).

Colour Depth

Colour depth (bit depth) is the number of bits used to represent each pixel’s colour. More bits = more possible colours = better quality = larger file.

  • Colour depth
  • Colours possible
  • Use case
  • 1-bit
  • 2 (black/white)
  • Simple icons, QR codes
  • 8-bit
  • 256
  • GIF images, simple graphics
  • 16-bit
  • 65,536
  • Older displays
  • 24-bit
  • 16,777,216
  • True colour — photos, modern displays
  • 32-bit
  • 16,777,216 + alpha
  • Transparency in graphics

Calculating File Size

Uncompressed image file size formula:

File size (bits) = width × height × colour depth

Divide by 8 for bytes, 1024 for KB, 1024² for MB.

Worked Examples

Calculate the file size of a 640×480 image at 24-bit colour depth

Pixels = 640 × 480 = 307,200

Bits = 307,200 × 24 = 7,372,800 bits

Bytes = 7,372,800 ÷ 8 = 921,600 bytes

= 900 KB (÷ 1024) ≈ 0.88 MB

A 200×200 image uses 8-bit colour depth. What is its uncompressed size in bytes?

  • 40,000
  • 320,000
  • 5,000
  • 160,000

Answer: 40,000
200×200×8 = 320,000 bits ÷ 8 = 40,000 bytes.

Doubling the colour depth of an image will:

  • Double the file size
  • Quadruple the file size
  • Halve the file size
  • Have no effect
  • Answer: 0

File size is directly proportional to colour depth.

What does “resolution” mean for a digital image?

  • The number of colours used
  • The number of pixels in the image
  • The file format used
  • The brightness of the image

Answer: The number of pixels in the image
Resolution = total number of pixels (width × height).


Previous lesson: Character sets: ASCII and Unicode
Back to Cambridge IGCSE Computer Science (0478)
Next lesson: Representing sound: sampling rate and bit depth