calculate the uncompressed size of a bitmap (raster) image,
explain how resolution, colour depth, colour model, alpha channel, file‑format overhead and row‑padding affect that size,
compare bitmap images with vector graphics and justify the most suitable format for a given task,
describe the difference between lossless and lossy compression and evaluate which method is appropriate in a particular situation.
Key concepts
Resolution
Number of pixels horizontally × vertically (e.g. 1920 × 1080). The total pixel count is w × h.
Colour depth (bits per pixel, bpp)
Bits required to store the colour of one pixel. Common depths are listed below.
Colour model
RGB (true colour) – each pixel stores separate red, green and blue components.
Indexed colour – pixel value is an index into a palette (e.g. 8‑bit = 256‑colour palette). The palette itself occupies 256 × 3 = 768 bytes in a BMP file.
Alpha channel
When present, an extra 8 bits per pixel store transparency. A 32‑bit image therefore uses 24 bits for RGB + 8 bits for alpha.
Bitmap (raster) image
Stores colour information for every pixel; file size grows with resolution × colour depth.
Vector graphic
Stores geometric primitives (lines, curves, shapes). Size depends on the number of objects, not on resolution.
File‑format overhead
Most bitmap formats have a header (e.g. BMP ≈ 54 bytes) and may pad each row to a 4‑byte boundary. These add a small, fixed amount to the total size.
Lossy (JPEG) – discards information that is less noticeable; much higher reduction but introduces artefacts.
Binary unit prefixes
1024 bytes = 1 kibi‑byte (KiB), 1024 KiB = 1 mebi‑byte (MiB), 1024 MiB = 1 gibi‑byte (GiB). The syllabus expects the use of KiB, MiB, GiB rather than the decimal kB/MB/GB.
Uncompressed size ≈ 1.98 MiB, illustrating how reducing colour depth dramatically lowers the file size.
Impact of changing resolution or colour depth
Resolution: Doubling both width and height multiplies the pixel count by 4, so the file size also quadruples.
Colour depth: Changing from 24‑bit to 8‑bit reduces the size by a factor of 3 (24 ÷ 8). Adding an 8‑bit alpha channel (32‑bit total) increases the size by 33 % compared with 24‑bit.
Choosing bitmap vs. vector – checklist and case study
Consideration
Bitmap (Raster)
Vector
Typical content
Photographs, complex gradients, screenshots
Logos, icons, schematics, line art
Scalability
Pixelation when enlarged
Infinitely scalable without loss
File‑size dependence
Resolution × colour depth (plus overhead)
Number of geometric primitives
Editing focus
Pixel‑level manipulation (photo retouching)
Shape‑level manipulation (design work)
Typical formats
BMP, PNG, JPEG, GIF
SVG, EPS, PDF (vector content)
Case study – responsive website header
The client needs a logo that looks sharp on screens ranging from 320 px wide (mobile) to 2560 px wide (4K monitors).
Option A: Provide a high‑resolution PNG (e.g., 2000 × 800 × 24‑bit). Uncompressed size ≈ 4.6 MiB; after PNG compression ≈ 0.9 MiB. The file must be downloaded each time the page loads.
Option B: Provide the logo as an SVG file (≈ 8 KB). The browser renders it at any size without loss of quality and the download is negligible.
Decision: Choose SVG because it guarantees crisp rendering on all devices, reduces bandwidth, and simplifies maintenance (single file for all resolutions).
Compression – numeric illustration
Using the 24‑bit BMP from Example 1 (2.64 MiB uncompressed):
Calculate the uncompressed file size of a 1024 × 768 image using a 32‑bit colour depth. Express your answer in MiB to two decimal places.
A digital camera saves photos as 24‑bit BMPs with a resolution of 4000 × 3000 pixels. What is the file size in GiB? (Round to two decimal places.)
If you reduce the colour depth of a 640 × 480 image from 24‑bit to 8‑bit, by what factor does the file size decrease?
Explain why a company would choose an SVG logo (vector) instead of a high‑resolution PNG (bitmap) for its website header.
Briefly describe two ways in which compression can reduce the size of a bitmap image, and state one advantage and one disadvantage of each method.
Using the 2.64 MiB BMP from Example 1, estimate the size after lossless PNG compression (assume a 3.5× reduction) and after high‑quality JPEG compression (assume a 9× reduction). Comment on the likely visual difference.
Answers (teacher reference)
Calculation
S = 1024 × 768 × 32 = 25 165 824 bits
Bytes = 25 165 824 ÷ 8 = 3 145 728 bytes
MiB = 3 145 728 ÷ 1 048 576 ≈ 3.00 MiB
S = 4000 × 3000 × 24 = 288 000 000 bits
Bytes = 288 000 000 ÷ 8 = 36 000 000 bytes
GiB = 36 000 000 ÷ 1 073 741 824 ≈ 0.03 GiB
Size ratio = 24 ÷ 8 = 3. The file becomes one‑third of the original size (a reduction factor of 3).
Vector graphics scale without pixelation and usually have a far smaller file size for simple shapes. This ensures the logo remains crisp on any screen resolution and reduces page‑load time.
Lossless compression (PNG): removes statistical redundancy. Advantage – no loss of visual quality. Disadvantage – lower reduction ratio than lossy methods.
Lossy compression (JPEG): discards information deemed less important to the eye. Advantage – very high reduction (often > 10×). Disadvantage – introduces artefacts and loss of detail.
PNG estimate: 2.64 MiB ÷ 3.5 ≈ 0.75 MiB. Visual quality remains virtually identical to the original.
JPEG estimate: 2.64 MiB ÷ 9 ≈ 0.29 MiB. The file is much smaller, but subtle colour gradients may show compression artefacts, especially in smooth sky or skin tones.
Suggested diagram: a grid of pixels (each coloured square labelled with its bit‑depth) beside a simple SVG shape (e.g., a circle) to illustrate that bitmap size depends on pixel count while vector size depends on object count.
Support e-Consult Kenya
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources,
past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.