Counting the pixels in an image
Total pixels = pixels per row times number of rows. For 1920 x 1080 that is 2,073,600 pixels. This is the first step when working out image file size.
Understanding Counting the pixels in an image in IGCSE Computer Science Paper 1
What it does: 800 pixels per row times 600 rows gives 480,000 pixels, which uses width times height. The total pixel count is calculated first and is then multiplied by the colour depth to find the file size in bits. 1920 * 1080 = 2,073,600. Adding them (1920 + 1080 = 3000) is a common mistake. Total pixels come first. The sample rate belongs to sound files, not images. 10 pixels per row * 4 rows = 40 pixels. 14 comes from adding instead of multiplying. 100 * 50 = 5,000 and 100 * 100 = 10,000. Changing the height changes the total pixels.
Common mistakes: The total was stored in a variable called pixels, but this line prints pixel, which does not exist. It should be print(pixels). A double equals sign compares two values. It does not store one. The width must be assigned with a single equals sign: width = 800.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 69–84) and word search (Modules 59–84).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
pixels = width * heightFill in the Blanks
Spot the Error
Student with a class code? Join your class →