Bitmap and vector graphics
Two ways to store a picture
- A computer can store an image as a grid of coloured dots, or as a set of drawing instructions.
- These are bitmap and vector graphics.
- Each is best for different jobs — and the difference shows when you zoom in.
Bitmap images
- A bitmap stores the colour of every pixel in a grid.
- Resolution = width × height in pixels (e.g. $1920 \times 1080$).
- Colour depth (bit depth) = bits per pixel: 1 bit → black/white; 8 bits → 256 colours; 24 bits → 16.7 million ("true colour").

The colour depth (bit depth) of a bitmap image is:
Colour depth is bits per pixel — more bits means more possible colours (8 bits → 256, 24 bits → 16.7 million).
How many bits of colour depth are needed to store 256 different colours?
$2^8 = 256$, so 8 bits per pixel give 256 colours.
Bitmap file size
- The file size depends on the pixel count and the colour depth:
- Divide by 8 for bytes. Example: $3000 \times 2000$ at 24 bpp $= 1.44 \times 10^8$ bits $\approx 17.2\ \text{MiB}$.
- Lower resolution or lower colour depth → smaller file but worse quality (blocky, or colour banding).
A $100 \times 100$ pixel image has a colour depth of 24 bits. What is its file size in bits?
size $=$ width $\times$ height $\times$ depth $= 100 \times 100 \times 24 = 240\,000$ bits.
Vector graphics
- A vector graphic stores the instructions to draw the image: geometric primitives (lines, curves, polygons, circles) with attributes (colour, fill, width, position).
- To display it, the program renders the instructions at whatever resolution is needed.
- So it scales without losing quality — a vector logo stays sharp at any size.
- But it cannot describe arbitrary pixel detail, so it is no good for photographs.
A vector logo becomes blurry when you enlarge it a lot.
Vectors are re-rendered from instructions at any size, so they stay sharp. It is bitmaps that blur when enlarged.
The main advantage of a vector graphic is that it:
Because it is drawn from instructions, a vector scales without blur — ideal for logos and diagrams (but not photos).
Bitmap vs vector
| Task | Better choice | Why |
|---|---|---|
| Photograph | Bitmap | per-pixel detail can't be shapes |
| Logo, icon, sign | Vector | sharp edges, scales to any size |
| Engineering drawing | Vector | precise geometry and scaling |
| Painting, texture | Bitmap | smooth tonal detail |
Which format is better for storing a photograph?
A photo has complex per-pixel detail that cannot be described as shapes, so a bitmap is the right choice.
You've got it
- bitmap = grid of pixels; resolution + colour depth (bits/pixel)
- bitmap file size $=$ width $\times$ height $\times$ colour depth (bits)
- vector = drawing instructions (primitives + attributes); scales without blur
- photos → bitmap; logos/diagrams → vector