Cambridge O Level Computer Science · Syllabus 2210 · Data Representation
Pixel
What is Pixel?
A pixel is one of the small squares that make up a bitmap image; the colour of each pixel is stored as a binary value. The number of pixels sets the image resolution and the bits per pixel set the colour depth, so both increase the file size.
This definition is part of the Data Representation chapter in Cambridge O Level Computer Science.
Pixel in context
Every form of data a computer handles — a number, a character, a sound, an image — is converted into binary before it can be processed or stored. The conversion is done by an agreed encoding rule: place value for numbers, a character set for text, sampling for sound, pixels and colour depth for images. The binary is then held in fixed-width registers and processed using logic gates. Nothing about the pattern 01000001 tells you whether it means the number 65, the character A, one sample of a sound or one pixel of an image — only the rule you were told to apply does.
A bitmap image is a grid of tiny squares called pixels. The colour of each pixel is stored as a binary value, and the whole image is simply that list of values in order. Two settings describe the image. The resolution is the number of pixels in the image — for a rectangular image, width × height. The colour depth is the number of bits used to represent each colour, that is the bits per pixel. Increasing either one increases the quality of the image and increases its file size.
For an uncompressed bitmap image, the file size in bits is the number of pixels multiplied by the colour depth. If the question gives the width and height, multiply those first to get the number of pixels; if it gives the resolution as a total number of pixels, use that directly. Then convert down to the unit the question asks for: bits → bytes → KiB → MiB.
Common mistakes with Pixel
- 6. Stopping a file-size calculation at width × height. Why it fails That gives the number of pixels, not the size. Every pixel still has to be multiplied by the colour depth, and the result then converted to the unit requested. Fix Say the sentence "pixels, then bits, then bytes, then the unit asked for" at the start of every image question.
- M15. "Colour depth means the number of pixels." Why it fails It swaps the two image settings. The number of pixels is the resolution. Correct model Colour depth is the number of bits used to represent the colour of each pixel. Exam-safe "The colour depth is the number of bits used to represent each colour; the resolution is the number of pixels in the image." Test yourselfHideQ. An image is 200 × 100 pixels with 8-bit colour depth. Which number is the resolution?A. 20 000 pixels. The 8 is the colour depth.
- M16. "Resolution means the number of colours." Why it fails The same swap in the other direction. The number of colours comes from the colour depth, as 2depth. Correct model Resolution counts pixels. Colours = 2colour depth. Exam-safe "The resolution is the number of pixels in the image; the number of possible colours is two to the power of the colour depth." Test yourselfHideQ. How many colours are available at a colour depth of 24 bits?A. 224 = 16 777 216.
- M17. "File size is width × height." Why it fails That gives the number of pixels. It says nothing about how many bits each pixel occupies. Correct model File size in bits = width × height × colour depth, then convert to the unit requested. Exam-safe "File size in bits equals the number of pixels multiplied by the colour depth." Test yourselfHideQ. A 100 × 100 image has 8-bit colour depth. What is 10 000 — the pixels or the size in bits?A. The pixels. The size is 10 000 × 8 = 80 000 bits.
- M21. "Lossless compression always produces a smaller file, and RLE works equally well on all data." Why it fails Lossless methods exploit patterns. Where there is no pattern there is nothing to exploit, and RLE in particular stores two items for every run — so data with no repetition gets bigger. Correct model RLE is most effective on data containing long runs of identical values, such as a two-colour logo with large flat areas. On a detailed photograph the runs are one pixel long and the encoded form can exceed the original. Exam-safe "Run-length encoding reduces file size only when the data contains long runs of repeated values; with little repetition each single value is stored as a pair, so the file may not shrink and could grow." Test yourselfHideQ. Apply RLE to ABCDEF and count the items.A. 1A 1B 1C 1D 1E 1F — 6 pairs = 12 items, against 6 originally. It has doubled.
Examiner tips on Pixel
- State your assumptions. These calculations assume the data is uncompressed, that there is no metadata or file header unless the question supplies one, and that the colour depth applies to every pixel. If a question does give a header size, add it after converting to a common unit — never before.

