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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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 colours, 8 bits gives 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 .
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 bits.
Convert to bytes: bytes.
Convert to kilobytes: KB.
Markers reward the three-stage method (bits, bytes, KB), the correct for the bit-to-byte step, and using 1000 per the AQA convention. Leaving the answer in bits or forgetting the 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 bits gives colours. Increasing the depth from 4 bits to 8 bits raises the number of colours from to , so the image can show more shades and look more realistic.
Because file size , doubling the colour depth (4 to 8) doubles the file size. For a 100 by 100 image: at 4 bits, bits; at 8 bits, bits.
Markers reward the colour rule, a worked size comparison, and the link between higher quality and larger files.
Related dot points
- Know that data is stored in bits and bytes, the units from bit to terabyte, and calculate file sizes and storage requirements.
A focused answer to AQA GCSE Computer Science 3.3.4, covering bits and bytes, the units from bit to terabyte, and calculating file sizes and storage requirements.
- Understand how analogue sound is sampled to be stored digitally, the effect of sample rate and bit depth on quality and file size, and calculate sound file sizes.
A focused answer to AQA GCSE Computer Science 3.3.7, covering how analogue sound is sampled for digital storage, the effect of sample rate and bit depth on quality and file size, and calculating sound file sizes.
- Understand why data is compressed, and the difference between lossy and lossless compression including run-length encoding and Huffman coding.
A focused answer to AQA GCSE Computer Science 3.3.8, covering why data is compressed and the difference between lossy and lossless compression, including run-length encoding and Huffman coding.
- Understand the binary, denary and hexadecimal number bases, why computers use binary, and convert between binary and denary.
A focused answer to AQA GCSE Computer Science 3.3.1, covering the binary, denary and hexadecimal number bases, why computers use binary, and how to convert between binary and denary.
Sources & how we know this
- AQA GCSE Computer Science (8525) specification — AQA (2020)