GCSE Revision Aid: This resource is designed to support your revision and may contain errors. If you find a discrepancy with your class teaching, your teacher is correct โ€” please let us know at gcserevise@scott.scottrix.co.uk.

CS20: Representing Images

Foundation Higher AQAEdexcelOCREduqas Data Representation

How images are stored as bitmap data using pixels, resolution and colour depth, and how these properties affect file size and quality.

Fastmail

๐Ÿ“‹ Bitmap Images

Definition: A bitmap image is made up of a grid of small squares called pixels (picture elements). Each pixel is assigned a binary value that represents its colour.

Computers store images as numbers. In a bitmap image, the image is divided into a grid of tiny squares called pixels. Each pixel stores a binary number that represents a specific colour. When viewed from a distance, these pixels blend together to form the complete image.

Example

A simple 3x3 black and white image of a cross:

1 0 1

0 1 0

1 0 1

Where 1 = black, 0 = white. This 9-pixel image needs 9 bits of storage (1 bit per pixel).

๐Ÿ“ Pixels and Resolution

Pixels

A pixel is the smallest addressable element of a bitmap image. Each pixel stores colour data as a binary value. The total number of pixels in an image determines its level of detail.

Resolution

Definition: Resolution is the number of pixels in an image, expressed as width x height. For example, 1920 x 1080 means 1920 pixels across and 1080 pixels down.
Example

An image with resolution 800 x 600 has 480,000 pixels.

An image with resolution 1920 x 1080 has 2,073,600 pixels.

The higher resolution image contains over 4 times as many pixels and will show much more detail.

Key Formula:
Total pixels = Width x Height
File size (bits) = Width x Height x Colour Depth

๐ŸŽจ Colour Depth

Definition: Colour depth (also called bit depth) is the number of bits used to represent the colour of each pixel. More bits per pixel means more possible colours.

The colour depth determines how many different colours can be represented in an image:

Colour Depth Bits per Pixel Number of Colours Example Use
1-bit 1 2 (black and white) Simple icons, fax
8-bit 8 256 GIF images, early games
16-bit 16 65,536 High colour displays
24-bit 24 16,777,216 True colour (photographs)
32-bit 32 4,294,967,296 True colour + alpha channel
Key Formula:
Number of colours = 2colour depth
Example: 8-bit colour = 28 = 256 colours
Example

A 24-bit image uses 8 bits for red, 8 bits for green, and 8 bits for blue (RGB). Each channel can represent 256 shades (0-255), giving 256 x 256 x 256 = 16,777,216 possible colours. This is known as "True Colour" because it is enough colours to represent what the human eye can distinguish.

๐Ÿ“ Calculating Image File Size

Image File Size Formula:
File size (bits) = Width (pixels) x Height (pixels) x Colour depth (bits per pixel)

To convert to bytes: divide by 8
To convert to kilobytes: divide by 8 x 1024
To convert to megabytes: divide by 8 x 1024 x 1024
Worked Example 1

Calculate the file size of a 1024 x 768 image with 24-bit colour depth.

File size = 1024 x 768 x 24

= 786,432 x 24

= 18,874,368 bits

= 18,874,368 / 8 = 2,359,296 bytes

= 2,359,296 / 1024 = 2,304 KB

= 2,304 / 1024 = 2.25 MB

Worked Example 2

Calculate the file size of a 640 x 480 image with 8-bit colour depth.

File size = 640 x 480 x 8

= 307,200 x 8

= 2,457,600 bits

= 2,457,600 / 8 = 307,200 bytes

= 307,200 / 1024 = 300 KB

Worked Example 3

A 2000 x 1500 image uses 16-bit colour depth. How many megabytes is the uncompressed file?

File size = 2000 x 1500 x 16

= 3,000,000 x 16

= 48,000,000 bits

= 48,000,000 / 8 = 6,000,000 bytes

= 6,000,000 / 1024 / 1024 = 5.72 MB

โš–๏ธ How Properties Affect File Size and Quality

Change Effect on File Size Effect on Quality
Increase resolution (more pixels) Increases Improves (more detail)
Decrease resolution (fewer pixels) Decreases Degrades (pixelation)
Increase colour depth Increases Improves (more colours, smoother gradients)
Decrease colour depth Decreases Degrades (banding, colour steps)
Important: There is always a trade-off between file size and image quality. Higher resolution and greater colour depth produce better images but require more storage space and bandwidth.

Doubling the Resolution

If you double both the width and the height of an image, the file size quadruples (4x), because the total number of pixels is width x height - doubling both means 2 x 2 = 4 times as many pixels.

Example

Image A: 100 x 100 at 24-bit = 100 x 100 x 24 = 240,000 bits

Image B: 200 x 200 at 24-bit = 200 x 200 x 24 = 960,000 bits

Doubling both dimensions = 4x the file size, not 2x.

Doubling the Colour Depth

Doubling the colour depth doubles the file size, as each pixel now uses twice as many bits.

Example

Image A: 100 x 100 at 8-bit = 100 x 100 x 8 = 80,000 bits

Image B: 100 x 100 at 16-bit = 100 x 100 x 16 = 160,000 bits

Doubling colour depth = 2x the file size.

๐Ÿ” Bitmap vs Vector Images

Property Bitmap Vector
Made of Pixels Geometric shapes (lines, curves)
Scaling up Becomes pixelated/blurred Stays sharp at any size
File size Large for detailed images Generally smaller
Best for Photographs Logos, diagrams, illustrations
Editing Edit individual pixels Edit properties of shapes
Examples JPEG, PNG, GIF, BMP SVG, AI
Exam Focus: The GCSE specification primarily focuses on bitmap images. However, you should understand the key differences between bitmap and vector representations.

โš ๏ธ Common Mistakes to Avoid

Mistake Why It's Wrong How to Fix It
Forgetting to convert bits to bytes File sizes are usually given in bytes or KB Always divide by 8 to get bytes first
Confusing resolution with image size on screen Resolution is pixel count, not physical dimensions Think of resolution as width x height in pixels
Saying "doubling resolution doubles file size" Doubling both dimensions quadruples the pixel count Remember: 2W x 2H = 4x pixels
Forgetting the formula includes colour depth File size depends on both pixel count and colour depth Always use: W x H x colour depth
Confusing bitmap with vector They store images in fundamentally different ways Bitmap = pixels; Vector = mathematical instructions

โ“ Practice Questions

Q1: An image has a resolution of 1920 x 1080 and a colour depth of 24 bits. Calculate the file size in megabytes.

Q2: What is the effect on file size if you double the width of an image but keep the height and colour depth the same?

Q3: An image uses 8-bit colour depth. How many different colours can it represent?

Q4: Explain the trade-off between image quality and file size when increasing colour depth.

Q5: A 500 x 400 image has a file size of 1,600,000 bits. What is the colour depth?

โœ… Answers

  1. File size = 1920 x 1080 x 24 = 49,766,400 bits = 6,220,800 bytes = 6,075 KB = 5.93 MB
  2. The file size doubles, because total pixels = W x H. Doubling W means 2W x H = 2 x (W x H), so twice as many pixels.
  3. 28 = 256 colours
  4. Increasing colour depth allows more colours to be represented, producing smoother gradients and more realistic images, but each pixel needs more bits, so the file size increases proportionally.
  5. Colour depth = 1,600,000 / (500 x 400) = 1,600,000 / 200,000 = 8 bits per pixel

๐ŸŽฏ Exam Tips

โš ๏ธ Common Errors

โœ— Thinking higher resolution always means a better image regardless of colour depth โœ“ Image quality depends on BOTH resolution (pixels) and colour depth (bits per pixel). A high-resolution image with 1-bit colour looks worse than a lower-resolution 24-bit colour image.

โœ— Confusing pixel resolution with image file size โœ“ File size depends on resolution ร— colour depth. Two images with the same pixel dimensions can have different file sizes if they use different colour depths.

โœ— Forgetting that increasing resolution or colour depth increases file size โœ“ Doubling the resolution (width and height) quadruples the number of pixels, and therefore quadruples the file size (assuming same colour depth).

โœ— Thinking vector images are made of pixels โœ“ Vector images use mathematical descriptions of shapes (coordinates, lines, curves), not pixels. They can be scaled without losing quality, unlike bitmap images.

โœ๏ธ Model Answer

Full-Mark Response

A bitmap image is 1024 ร— 768 pixels with 24-bit colour depth. Calculate the file size in megabytes. If the colour depth is reduced to 8 bits, calculate the new file size and the percentage reduction. [4 marks]

Original file size: Number of pixels = 1024 ร— 768 = 786,432 File size in bits = 786,432 ร— 24 = 18,874,368 bits File size in bytes = 18,874,368 รท 8 = 2,359,296 bytes File size in MB = 2,359,296 รท (1024 ร— 1024) = 2.25 MB Reduced colour depth (8-bit): File size = 786,432 ร— 8 รท 8 รท (1024 ร— 1024) = 0.75 MB Percentage reduction = (2.25 - 0.75) รท 2.25 ร— 100 = 66.7% Reducing colour depth from 24-bit to 8-bit reduces the file size by approximately 66.7%.

๐Ÿ“Š AO Deep Dive

Assessment Objective Analysis

AO1 (Computational Thinking โ€” 40%): Demonstrate knowledge and understanding of the principles and concepts of computer science, including representing images: bitmap and vector graphics for AQA 8525, OCR J277 & Edexcel 1CP2.

AO2 (Application โ€” 40%): Apply knowledge and understanding of computer science, including representing images: bitmap and vector graphics to analyse problems in computational terms and to design, write and evaluate solutions.

AO3 (Evaluation โ€” 20%): Evaluate the effectiveness, correctness and efficiency of computational solutions, including representing images: bitmap and vector graphics, and make reasoned judgements about trade-offs.

๐Ÿ“ Exam Technique

GCSE Computer Science Exam Tips:
File size formula: width ร— height ร— colour depth (in bits), then convert to bytes/KB/MB. 1 byte = 8 bits, 1 KB = 1024 B, 1 MB = 1024 KB. For resolution changes: doubling both dimensions quadruples pixels. Bitmap = pixels, Vector = mathematical shapes. Vector advantages: scalable without quality loss, smaller for simple graphics. Bitmap advantages: better for photographs.

๐Ÿ“ Exam Questions by Topic

๐ŸŽฌ Video Resources

Share this page

Ready to ace your GCSE Computer Science exams?

Get the best revision books and guides to boost your grades.