Images Cambridge IGCSE Computer Science revision

Not started

Learn it

In plain words

A digital image is a grid of tiny squares called pixels. Each pixel is one colour, and the colour is stored as a binary number. From a distance your eye blends the squares into a picture.

Two numbers decide how good the image looks and how big its file is: how many pixels there are, and how many bits describe each one.

6 things to know

  1. An image is a series of pixels that are converted to binary, which is processed by a computer.
  2. The resolution is the number of pixels in the image: its width in pixels multiplied by its height.
  3. The colour depth is the number of bits used to represent the colour of each pixel.
  4. With a colour depth of n bits, each pixel can be one of 2ⁿ colours. One bit gives 2 colours, 8 bits give 256.
  5. A higher resolution or a higher colour depth improves the quality of the image and makes the file larger.
  6. File size in bits = width × height × colour depth.

Worked example

An image is 1024 pixels wide and 768 pixels high, with a colour depth of 24 bits. Calculate its file size in mebibytes.

  1. Bits = 1024 × 768 × 24. Do not multiply it out yet.
  2. To bytes, divide by 8: 1024 × 768 × 3 bytes.
  3. To kibibytes, divide by 1024: 768 × 3 = 2304 KiB.
  4. To mebibytes, divide by 1024 again: 2304 ÷ 1024 = 2.25 MiB.

Tips and tricks

  • Calculators are not allowed in the Cambridge papers. Cancel the 8 and the 1024s before you multiply, as in the example.
  • "More colours" comes from colour depth. "More detail" comes from resolution. Do not swap them.
6 questions, about 2 minutes.

It lands in your notebook with its questions as flashcards.

Images: 6 questions and answers

These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.

  1. What is a pixel?
    • the number of colours in an image
    • one of the tiny single-colour squares that make up an image (the answer)
    • a kind of compression
    • the size of an image file

    An image is a grid of pixels.

  2. How many different colours can an image have if its colour depth is 3 bits?
    • 3
    • 6
    • 8 (the answer)
    • 9

    2 × 2 × 2 = 8.

  3. What is the resolution of an image?
    • the number of bits for each pixel
    • the number of pixels in the image (the answer)
    • the size of the screen
    • the number of colours used

    Width in pixels × height in pixels.

  4. What is the effect of increasing the colour depth?
    • fewer colours and a smaller file
    • fewer colours and a larger file
    • more colours and a smaller file
    • more colours and a larger file (the answer)

    Each pixel needs more bits, so more colours are possible and there is more to store.

  5. An image is 100 pixels by 100 pixels with a colour depth of 16 bits. What is its file size?
    • 1600 bytes
    • 10 000 bytes
    • 20 000 bytes (the answer)
    • 160 000 bytes

    100 × 100 × 16 = 160 000 bits, and 160 000 ÷ 8 = 20 000 bytes.

  6. How many bits are needed for each pixel if an image uses 256 different colours?Stretch
    • 4
    • 8 (the answer)
    • 16
    • 256

    2 multiplied by itself eight times is 256.

Still stuck on this one?Ask in the Papermunch Discord, or help someone else who is. Discord is for ages 13 and up.Join the server

Things you can type

Or go straight to

Or browse a shelf