📁 Paper 1 · Topic 1: Data Representation
1.2b Representing Images in Binary
Cambridge IGCSE Computer Science 0478 · ~11 min read · ⭐ Pro

Pixels and Bitmaps

A digital image is made up of tiny squares called pixels (picture elements). Each pixel stores a single colour value. The collection of all pixels in an image is called a bitmap.

In a black-and-white image, each pixel is 0 (white) or 1 (black) — just 1 bit. In a grayscale or colour image, more bits are needed per pixel.

Colour Depth

Colour depth (also called bit depth) is the number of bits used to represent each pixel. More bits per pixel = more possible colours.

  • 1 bit: 2 colours (black and white)
  • 8 bits: 256 colours
  • 16 bits: 65 536 colours
  • 24 bits: 16 777 216 colours (True Colour / RGB)

Number of colours = 2colour depth

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 → more pixels → more detail → larger file size
  • Lower resolution → fewer pixels → less detail → smaller file size

File Size Calculation

Image file size (bits) = number of pixels × colour depth (bits per pixel)

Number of pixels = width (pixels) × height (pixels)

Example: A 200 × 150 pixel image with 24-bit colour depth:

  • Total pixels = 200 × 150 = 30 000
  • File size = 30 000 × 24 = 720 000 bits = 90 000 bytes = 87.9 KB

Metadata

Image files also contain metadata — additional data stored alongside the image itself. Examples include: image width and height, colour depth, file format, date taken, and for photos, GPS location or camera settings. Metadata increases the overall file size slightly beyond just the pixel data.

Exam tip: Cambridge 0478 often asks you to calculate image file size. Remember the formula: File size (bits) = width × height × colour depth. Then divide by 8 for bytes, by 1024 for KB, by 1024 again for MB.
⚠️ Common Mistakes
  • Forgetting to multiply width × height to get total pixels before multiplying by colour depth
  • Confusing resolution (pixels per inch) with total image size (width × height)
  • Not converting bits to bytes when asked for the answer in bytes (÷8)
  • Ignoring that metadata adds to file size beyond just the pixel data
Video coming soon
Click slide or press arrow keys to navigate
✍️

Worksheet — Images in Binary

5 questions · 10 marks

Q1Define the term 'pixel'.[1]
✅ Mark scheme
A pixel is the smallest element/dot that makes up a digital image [1]
Q2An image uses a colour depth of 4 bits. How many different colours can be represented?[2]
✅ Mark scheme
2⁴ [1] = 16 colours [1]
Q3Calculate the file size in bytes of an image that is 640 × 480 pixels with a colour depth of 16 bits.[3]
✅ Mark scheme
640 × 480 = 307 200 pixels [1]; × 16 = 4 915 200 bits [1]; ÷ 8 = 614 400 bytes [1]
Q4Explain how increasing the colour depth of an image affects its quality and file size.[2]
✅ Mark scheme
More colours can be represented so the image quality/detail increases [1]; but the file size increases because more bits are needed per pixel [1]
Q5State what metadata is in the context of an image file, and give one example.[2]
✅ Mark scheme
Metadata is data about the image stored alongside the image itself [1]; e.g. image dimensions / colour depth / date taken / GPS location / camera settings [1]
Quiz — Images
Q 1 of 8
Score
/ 8
Click to reveal
TermDefinition
🎯

Mini Test — Images in Binary

10 minutes · 9 marks

← 1.2a Text (ASCII/Unicode) Topic 1: Data Representation Next: 1.2c Sound →
🔒
Pro Content
Subscribe to access all lessons.
£7.99/month
or £59/year
Subscribe now →