Skip to main content
EnglandComputer ScienceSyllabus dot point

How is a picture stored as binary?

Understand how a bitmap image is represented using pixels and colour depth, the effect of resolution and colour depth on quality and file size, and the role of metadata.

A focused answer to AQA GCSE Computer Science 3.3.6, covering how bitmap images are represented using pixels and colour depth, the effect of resolution and colour depth on quality and file size, and metadata.

Generated by Claude Opus 4.88 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Pixels and colour depth
  3. Resolution
  4. File size
  5. Metadata
  6. The trade-off between quality and file size
  7. How a bitmap is stored and read back
  8. Try this

What this dot point is asking

AQA wants you to explain how a bitmap image is stored using pixels and colour depth, describe how resolution and colour depth affect quality and file size, and explain what metadata is and why it is needed.

Pixels and colour depth

So 1 bit per pixel gives 2 colours (black and white), 4 bits gives 24=162^4 = 16 colours, 8 bits gives 28=2562^8 = 256 colours, and 24-bit "true colour" gives over 16 million colours (8 bits each for red, green and blue). Because the image is a grid of independent pixels, zooming in far enough on a bitmap reveals the individual squares, which is why enlarging a low-resolution image looks blocky.

Resolution

File size

Metadata

The trade-off between quality and file size

Resolution and colour depth both improve quality but both enlarge the file, so storing an image is always a balance. Doubling the colour depth doubles the file size, and doubling both the width and the height multiplies the number of pixels (and so the size) by four. This is why a photo for a website is saved at a sensible resolution and often compressed, while a print needs a much higher resolution. Beyond the limit of what the screen can show or the eye can distinguish, extra resolution or colour depth only wastes storage, so the right setting matches the image to its purpose.

How a bitmap is stored and read back

A bitmap file stores the colour value of every pixel, one after another, as a long run of binary. On its own this stream is meaningless, because the computer does not know how to arrange the pixels into a grid. That is where metadata comes in: the stored width, height and colour depth tell the computer how many pixels make up each row and how many bits to read per pixel, so it can rebuild the grid exactly. Reading the file therefore means reading the metadata first, then slicing the pixel data into rows of the stated width, each pixel taking the stated number of bits.

Try this

Q1. State how many colours can be stored with a colour depth of 4 bits. [1 mark]

  • Cue. 16, because 24=162^4 = 16.

Q2. State one effect of increasing the resolution of an image. [1 mark]

  • Cue. More detail and sharper quality, but a larger file size.

Exam-style practice questions

Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

AQA 20194 marksA bitmap image is 640 pixels wide by 480 pixels high with a colour depth of 8 bits. Calculate the file size in kilobytes, ignoring metadata. Use 1 kilobyte = 1000 bytes.
Show worked answer →

Total bits =width×height×colour depth=640×480×8=2457600= \text{width} \times \text{height} \times \text{colour depth} = 640 \times 480 \times 8 = 2457600 bits.

Convert to bytes: 2457600÷8=3072002457600 \div 8 = 307200 bytes.

Convert to kilobytes: 307200÷1000=307.2307200 \div 1000 = 307.2 KB.

Markers reward the three-stage method (bits, bytes, KB), the correct ÷8\div 8 for the bit-to-byte step, and using 1000 per the AQA convention. Leaving the answer in bits or forgetting the ÷8\div 8 are the usual lost marks.

AQA 20224 marksExplain the effect of increasing the colour depth of a bitmap image on the number of colours available and on the file size. Use a calculation to support your answer.
Show worked answer →

Colour depth is the number of bits per pixel, and nn bits gives 2n2^n colours. Increasing the depth from 4 bits to 8 bits raises the number of colours from 24=162^4 = 16 to 28=2562^8 = 256, so the image can show more shades and look more realistic.

Because file size =width×height×colour depth= \text{width} \times \text{height} \times \text{colour depth}, doubling the colour depth (4 to 8) doubles the file size. For a 100 by 100 image: at 4 bits, 100×100×4=40000100 \times 100 \times 4 = 40000 bits; at 8 bits, 100×100×8=80000100 \times 100 \times 8 = 80000 bits.

Markers reward the 2n2^n colour rule, a worked size comparison, and the link between higher quality and larger files.

Related dot points

Sources & how we know this