Representing images with pixels

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

Representing images with pixels

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. How is a digital image made up?
A One big smooth colour with no parts
B A grid of tiny squares called pixels
2. How does a computer store each pixel?
A As a number
B As a drawing
3. In a simple black and white image, which number can stand for a black pixel?
A 7
B 1
4. A row of pixels is stored as 1 0 0 1. Which pixels are black?
A The first and the last
B The two in the middle
5. Which row of numbers shows white, black, white, black?
A 0 1 0 1
B 1 0 1 0

Match the Pairs

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

Left columnRight column
18 x 8 grid = 64 pixels AAn image made of 8 rows and 8 columns of squares has 64 pixels in total
20 1 1 0 BThe rows and columns were added instead of multiplied. 4 x 3 makes 12 pixels.
3A black pixel is stored as the number 1 CA row of four pixels: white, black, black, white
4A higher resolution image has more pixels, so it shows more detail DIn a black and white image only 0 and 1 are used. White is 0, not 5.
5A white pixel is stored as 5 Epixel = 1
6A 4 x 3 grid has 7 pixels Fresolution = 1920 x 1080

Definitions

pixel

Fill in the Blanks

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

1.
A digital image is a grid of ______
2.
A black pixel is stored as the number _
3.
More pixels means higher __________
4.
width = 4, height = 3 total pixels = 4 * 3 = __
5.
Each pixel is stored as a ______

Spot the Error

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

Question 1
A # Black and white pixels
B white = 1
C black = 1
D pixel = black
Question 2
A image = [0, 1, 1, 0
B pixels = len(image)
C print(pixels)
Question 3
A row1 = [0, 1, 1, 0]
B row2 = [1, 0, 2, 1]
C row3 = [0, 1, 1, 0]
Question 4
A width, height = 8, 6
B total = width + height
C print(total)
Question 5
A row1 = [0, 1, 0]
B row2 = [1, 1, 1]
C row3 = [0, 1, 0]
D print(row1) # all black

Answer Key

Representing images with pixels
Section A: Quick Questions
Q1
B — A grid of tiny squares called pixels
Q2
A — As a number
Q3
B — 1
Q4
A — The first and the last
Q5
A — 0 1 0 1
Section B: Match the Pairs
Q1
8 x 8 grid = 64 pixels → An image made of 8 rows and 8 columns of squares has 64 pixels in total
Q2
0 1 1 0 → A row of four pixels: white, black, black, white
Q3
A black pixel is stored as the number 1 → pixel = 1
Q4
A higher resolution image has more pixels, so it shows more detail → resolution = 1920 x 1080
Q5
A white pixel is stored as 5 → In a black and white image only 0 and 1 are used. White is 0, not 5.
Q6
A 4 x 3 grid has 7 pixels → The rows and columns were added instead of multiplied. 4 x 3 makes 12 pixels.
Section C: Definitions
Q1
pixel — A pixel is one tiny square in a grid that makes up a digital image. Each pixel is stored as a number, such as 0 for white or 1 for black.
Section D: Fill in the Blanks
Q1
A digital image is a grid of pixels
Q2
A black pixel is stored as the number 1
Q3
More pixels means higher resolution
Q4
width = 4, height = 3 total pixels = 4 * 3 = 12
Q5
Each pixel is stored as a number
Section E: Spot the Error
Q1
B — In black and white images, white pixels are stored as 0, not 1. It should be white = 0. Black is the pixel stored as 1.
Q2
A — The list of pixel numbers is missing its closing square bracket. It should be image = [0, 1, 1, 0].
Q3
B — A black and white pixel can only be 0 or 1. The 2 is not a valid pixel number. It should be row2 = [1, 0, 0, 1].
Q4
B — The number of pixels in a grid is the width multiplied by the height, not added. It should be total = width * height, which gives 48.
Q5
D — Row 1 is [0, 1, 0], so it has white pixels. The all black row is row2, which is [1, 1, 1]. It should be print(row2).