- Describe how vector graphics represent images as objects and attributes
- Identify the four vector objects required at N5: rectangle, ellipse, line, polygon
- Identify the three vector attributes required at N5: coordinates, fill colour, line colour
- Describe how bitmap graphics represent images as a grid of pixels
- Explain the terms resolution, bit depth and colour depth in relation to bitmaps
- Calculate the file size of a bitmap image
- Compare the advantages and disadvantages of vector and bitmap graphics
- I can describe what a vector graphic is and name the four N5 objects
- I can list the three N5 vector attributes and explain what each one does
- I can describe how a bitmap graphic stores image data using pixels
- I can explain what bit depth means and calculate how many colours a given bit depth can represent
- I can calculate the file size of a bitmap image given resolution and bit depth
- I can compare vector and bitmap graphics, giving advantages and disadvantages of each
Answer before the lesson begins. These check prior knowledge — it's fine if you're unsure.
1. How many colours can be represented using 1 bit per pixel?
2. How many colours can be represented using 8 bits per pixel?
3. A screen is described as 1920 × 1080 pixels. How many pixels does it contain in total?
Key vocabulary
Data Representation: Graphics
Two ways to store graphics
Computers can store images in two fundamentally different ways. The method chosen affects the file size, the quality when the image is scaled, and what the image is best suited for. Understanding the difference between vector and bitmap graphics is a core exam topic in N5 Computer Systems.
Vector graphics — images as instructions
A vector graphic does not store a picture dot-by-dot. Instead, it stores a list of mathematical instructions describing the shapes (objects) that make up the image, along with the properties (attributes) of each shape. The image is reconstructed from those instructions every time it is displayed.
Objects are the building blocks of a vector image. At N5, you need to know four — a useful mnemonic is RELP:
- Rectangle — a four-sided shape with right angles
- Ellipse — an oval or circle shape
- Line — a straight line between two points
- Polygon — an irregular multi-sided shape defined by a series of points
Attributes define how each object looks. At N5, three attributes are required — a useful mnemonic is CFL:
- Coordinates — the position of the object on the canvas (e.g. x=50, y=100)
- Fill colour — the colour inside the shape
- Line colour — the colour of the shape's border/outline
For example, a red rectangle with a black outline might be described as:
Rectangle(x=10, y=20, width=200, height=100, fillColour=red, lineColour=black)
This is a compact description — just a few values. The graphic itself is redrawn each time it is displayed by following those instructions.
Advantages of vector graphics:
- Images can be scaled to any size without loss of quality, because they are redrawn from the instructions each time
- File sizes are small for simple illustrations (only a list of object descriptions is stored)
- Individual objects can be selected and edited independently
Disadvantages of vector graphics:
- Not suitable for photographs or real-life images — natural scenes contain too much variation to describe mathematically as a list of objects
- Complex images with many objects can still produce large files
Bitmap graphics — images as grids of pixels
A bitmap graphic divides the image into a regular 2D grid of tiny squares called pixels. Each pixel is assigned a colour value, which is stored as a binary number. When the image is displayed, the computer reads every pixel's binary value and lights up the corresponding dot on the screen.
Resolution describes the number of pixels in an image, typically expressed as width × height (e.g. 1920 × 1080). The total pixel count is width multiplied by height. A higher resolution means more detail — and more data to store.
Bit depth (also called colour depth) is the number of bits used to store each pixel's colour. The more bits per pixel, the more colours can be represented. The formula is 2n, where n is the bit depth:
- 1 bit per pixel → 21 = 2 colours (black and white only)
- 4 bits per pixel → 24 = 16 colours
- 8 bits per pixel → 28 = 256 colours
- 24 bits per pixel → 224 = 16,777,216 colours ("true colour")
Each additional bit doubles the number of possible colours.
Calculating file size:
File size (in bits) = number of pixels × bit depth
= (width × height) × bits per pixel
To convert bits to bytes, divide by 8. To convert bytes to kilobytes, divide by 1024.
Advantages of bitmap graphics:
- Can capture real-life detail (photographs from digital cameras, scanned images)
- Directly maps to how screens display images — one pixel in the file corresponds to one pixel on screen
- Universally supported by all software
Disadvantages of bitmap graphics:
- Scaling up causes pixelation — the image becomes blocky because the pixel grid is fixed and cannot be redrawn at a new size
- File sizes can be very large for high-resolution, high colour-depth images
- Editing one part of the image affects the surrounding pixels
Comparing the two methods
A photograph taken on a phone camera is always a bitmap — it captures real-world detail pixel by pixel. A company logo or a diagram created in a drawing package is typically a vector — it needs to be printed at many different sizes without losing quality. Both formats are essential; choosing the right one depends on the content and its intended use. Diagrams, logos, and illustrations suit vectors; photographs and scanned images suit bitmaps.
Worked examples
"A circle is drawn with its centre at coordinates (150, 200), a yellow fill and a blue outline. Identify the object type and state its three N5 attributes."
"An image uses 4 bits per pixel. How many different colours can be displayed?"
"A bitmap image is 640 pixels wide and 480 pixels tall. It uses 24-bit colour. Calculate the file size in bits, bytes, and kilobytes."
"Explain what happens when you scale up a vector graphic compared to a bitmap graphic."
A bitmap image is 200 pixels wide and 150 pixels tall. It uses a bit depth of 8.
Show your working for each step:
- Calculate the total number of pixels in the image.
- Calculate the file size in bits.
- Convert the file size to bytes.
- Total pixels: 200 × 150 = 30,000 pixels.
- File size in bits: 30,000 × 8 = 240,000 bits.
- Convert to bytes: 240,000 ÷ 8 = 30,000 bytes.
File size calculations appear regularly in N5 exams. Memorise the formula: file size (bits) = width × height × bit depth. Always show each step in your working — marks are awarded for method even if you make an arithmetic error. Also practise identifying whether a described graphic is vector or bitmap from context clues in the question: diagrams and logos → vector; photographs and scans → bitmap. If asked to "justify" your choice, refer explicitly to the property that makes one type more suitable (e.g. "scalability" for vector, "capturing real-life detail" for bitmap).
Questions 1–5 are auto-checked. Questions 6–10 are self-marked — write your answer, then reveal the model answer to check your work.
1. Which of the following is stored as a list of objects and attributes? TYPE 1
2. Which of the following is NOT one of the four N5 vector objects? TYPE 1
3. What does bit depth determine in a bitmap image? TYPE 1
4. An image has a bit depth of 3. How many colours can be displayed? TYPE 1
5. A bitmap image is 100 × 100 pixels with a bit depth of 8. What is the file size in bits? TYPE 1
6. Describe what is meant by "resolution" in relation to a bitmap image. TYPE 2
7. A vector graphic stores an ellipse. State three attributes that would be used to describe it at N5. TYPE 2
8. Give one advantage of vector graphics over bitmap graphics, and one advantage of bitmap graphics over vector graphics. TYPE 2
Bitmap advantage: bitmaps can capture real-life detail such as photographs, which vector graphics cannot represent accurately as a list of objects.
9. A designer is creating (a) a company logo and (b) a background photograph for a website. State which type of graphic — vector or bitmap — is more suitable for each, and justify your answers. TYPE 3
(b) Bitmap — a photograph captures real-world detail pixel by pixel. Vector graphics cannot represent the natural variation in colour and texture found in photographs; a bitmap is the appropriate format.
10. A bitmap image is 1024 pixels wide and 768 pixels tall. It has a bit depth of 24. (a) Calculate the file size in bits. (b) Calculate the file size in bytes. (c) Explain one way a designer could reduce the file size without changing the resolution. TYPE 3
(b) 18,874,368 ÷ 8 = 2,359,296 bytes (approximately 2.25 MB).
(c) Reduce the bit depth — using fewer bits per pixel means fewer possible colours, but each pixel takes up less storage, so the overall file size decreases proportionally. (For example, reducing from 24-bit to 8-bit would cut the file size to one third.)
Suggested timing: ~50 minutes. Warm up 8 min; notes + SVG diagrams 18 min; worked examples 10 min; now you try 5 min; task set 9 min.
Key misconception — file size calculation: The most common exam error is applying bit depth before multiplying width × height. Drill the two-step process explicitly: step 1 = total pixels (width × height); step 2 = × bit depth. Consider writing it on the board as a formula and asking pupils to label each part.
Mnemonics: RELP (Rectangle, Ellipse, Line, Polygon) for the four N5 objects; CFL (Coordinates, Fill colour, Line colour) for the three N5 attributes. Both are straightforward to memorise.
SVG diagrams: This lesson contains inline SVG diagrams illustrating vector attributes and bitmap pixel grids. These are a concrete demonstration of the concept — pupils are studying vector graphics, so showing them live SVG code (view-source) and its rendered output is a genuine pedagogical bonus if time allows.
Extension: Ask pupils what happens to file size if you double both the width and height (answer: it quadruples — 2× width × 2× height = 4× total pixels). This reinforces why high-resolution photography files are so large.
Compression note: If pupils ask about JPEG/PNG compression, note that this is covered in WDD, not CS. At CS level, the uncompressed calculation is all that is required.
Links to CS4: CS3 leads directly into CS4 (Sound). The underlying pattern continues — all data = binary numbers. Sound adds sampling frequency and bit depth to the same conceptual framework pupils have just learned here.
SQA command words covered: "describe", "identify", "state", "explain", "calculate", "justify".