Raster (bitmap) images

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Raster (bitmap) images

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A photo taken on a phone is stored as a raster image. What is a raster image made of?
A Lines and shapes described by maths formulas
B A grid of tiny pixels, each storing colour numbers
2. Another name for a raster image is a...
A Vector
B Bitmap
3. You zoom in a long way on a photo and see blocky squares. What are you seeing?
A Pixelation: the individual pixels of the raster image
B A fault where the file has been damaged
4. What does each pixel in a raster image store?
A Numbers that describe its colour
B A copy of the whole picture
5. Which of these is usually stored as a raster image?
A A photo of your friends at the beach
B A text message saying 'Hello'

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1raster image AAnother name for a raster image, a picture stored pixel by pixel
2bitmap BBitmaps get pixelated when zoomed in. Only the fixed pixels are enlarged, so the photo looks blocky.
3A photo is a raster image, so every pixel stores its own RGB colour numbers CA picture made of a grid of tiny pixels, where each pixel stores its colour as numbers
4Zooming in on a raster image makes the pixels visible, so it looks blocky (pixelated) Dpixel = (255, 128, 0)
5A raster image is stored as lines and shapes drawn from maths formulas EThis describes a vector image. A raster image is stored as a grid of pixels, each with colour numbers.
6A photo stays perfectly smooth no matter how far you zoom in, because it is a bitmap Fzoom 800% -> blocky squares

Definitions

raster image

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
<img src="photo.___" alt="A raster image">
2.
img { image-rendering: _________; }
3.
pixel(2, 3) ← [___, 0, 0]
4.
FOR each _____ IN image DISPLAY colour of pixel END FOR
5.
width ← 4 height ← 3 total ← width * ______

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A kind = "raster"
B width = 4
C height = 3
D pixels = width + height
Question 2
A photo_is_raster = False
B if photo_is_raster:
C print("Made of pixels")
Question 3
A zoom = 8
B pixel_size = 1 / zoom
C blocky = pixel_size > 1
Question 4
A grid = [[0, 255], [255, 0]
B row = grid[0]
C print(row[1])
Question 5
A for row in image:
B for pixel in row:
C print(pixel[3])

Answer Key

Raster (bitmap) images
Section A: Quick Questions
Q1
B — A grid of tiny pixels, each storing colour numbers
Q2
B — Bitmap
Q3
A — Pixelation: the individual pixels of the raster image
Q4
A — Numbers that describe its colour
Q5
A — A photo of your friends at the beach
Section B: Match the Pairs
Q1
raster image → A picture made of a grid of tiny pixels, where each pixel stores its colour as numbers
Q2
bitmap → Another name for a raster image, a picture stored pixel by pixel
Q3
A photo is a raster image, so every pixel stores its own RGB colour numbers → pixel = (255, 128, 0)
Q4
Zooming in on a raster image makes the pixels visible, so it looks blocky (pixelated) → zoom 800% -> blocky squares
Q5
A raster image is stored as lines and shapes drawn from maths formulas → This describes a vector image. A raster image is stored as a grid of pixels, each with colour numbers.
Q6
A photo stays perfectly smooth no matter how far you zoom in, because it is a bitmap → Bitmaps get pixelated when zoomed in. Only the fixed pixels are enlarged, so the photo looks blocky.
Section C: Definitions
Q1
raster image — A picture made of a grid of tiny pixels, each storing its colour as numbers. Also called a bitmap. Photos are raster images and look blocky (pixelated) when zoomed in.
Section D: Fill in the Blanks
Q1
<img src="photo.bmp" alt="A raster image">
Q2
img { image-rendering: pixelated; }
Q3
pixel(2, 3) ← [255, 0, 0]
Q4
FOR each pixel IN image DISPLAY colour of pixel END FOR
Q5
width ← 4 height ← 3 total ← width * height
Section E: Spot the Error
Q1
D — The number of pixels in a grid is width multiplied by height (4 x 3 = 12), not added. It should be pixels = width * height.
Q2
A — Photos are raster images, so the value should be True. With False, the message about pixels would never print.
Q3
B — Zooming in makes each pixel appear bigger, so multiply by zoom. Dividing would shrink the pixels. It should be pixel_size = 1 * zoom.
Q4
A — The outer square bracket is never closed, so the grid of pixel values is a syntax error. It needs a final ] at the end.
Q5
C — Each pixel stores three colour numbers (red, green, blue) at positions 0, 1 and 2. Position 3 does not exist. It should be pixel[0], pixel[1] or pixel[2].