← ACARA Digital Technologies Years 7–8

Inspecting a pixel's RGB numbers

A tool that picks one pixel in an image and shows the red, green and blue numbers (0 to 255) stored for it, such as rgb(255, 0, 0) for pure red.

Understanding Inspecting a pixel's RGB numbers in ACARA Digital Technologies Years 7–8

What it does: When all three numbers are at their maximum of 255, the pixel is white. The red, green and blue numbers differ by only a few steps, so the two neighbouring pixels look nearly identical. An eyedropper picks a single pixel and reveals the RGB numbers stored for it. Each channel uses one byte (8 bits), so it can store 256 values from 0 to 255. The order is always red, green, blue, so the last number (255) is blue. Red is at its maximum of 255 while green and blue are 0, so the pixel viewer reports a pure red pixel.

Common mistakes: Line 3 should read the green number. An eyedropper only stores red, green and blue numbers for a pixel, so there is no yellow value. It should be print(pixel.green). Each RGB number must be from 0 to 255. Pure red is (255, 0, 0), so 256 is out of range. It should be rgb = (255, 0, 0).

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 153–172) and word search (Modules 153–188).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A pixel viewer shows rgb(255, 0, 0) for the pixel you clicked. What colour is that pixel?
Pure redPure green
Matches
rgb(300, 20, 40)
↓
The red number is 300, but each RGB number stored for a pixel must be between 0 and 255. An eyedropper would never show 300.
Applying
Meanings
Term
eyedropper
Meaning
A tool that picks one pixel in an image and shows the red, green and blue numbers (0 to 255) stored for it, such as rgb(255, 0, 0) for pure red.
Practice
<div style="background: rgb(200, 30, 30);">
Testing
Gaps
colour = (photo, 40, 25)
Check Answer
Spots
2print(pixel.red)
3print(pixel.yellow)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Octopus' badge — Multi-Tasker, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A pixel viewer shows rgb(255, 0, 0) for the pixel you clicked. What colour is that pixel?
A. Pure red ✓
B. Pure green
The three numbers are red, green, blue in that order. 255 red with 0 green and 0 blue is pure red.
2. What does an eyedropper tool do when you click on an image?
A. Shows the red, green and blue numbers stored for that one pixel ✓
B. Shows the average colour of the whole image
An eyedropper picks a single pixel and reveals the RGB numbers stored for it.
3. Which range of numbers can each of the red, green and blue values be in an 8-bit-per-channel pixel?
A. 0 to 100
B. 0 to 255 ✓
Each channel uses one byte (8 bits), so it can store 256 values from 0 to 255.
4. You use an eyedropper on a pixel and see rgb(0, 0, 255). Which statement is correct?
A. The red number is 255 and green and blue are 0
B. The blue number is 255 and red and green are 0 ✓
The order is always red, green, blue, so the last number (255) is blue.
5. You compare two neighbouring pixels in a smooth blue sky: rgb(30, 144, 255) and rgb(31, 145, 255). What do you expect?
A. The numbers are very similar ✓
B. The numbers are completely different
In a smooth area, neighbouring pixels have almost the same RGB numbers. That is why the colour looks smooth.

Match the Pairs

rgb(255, 0, 0) → The numbers an eyedropper shows for a pure red pixel: full red, no green, no blue
rgb(0, 0, 255) → The numbers a pixel viewer shows for a pure blue pixel: no red, no green, full blue
An eyedropper picked a pixel and showed that red, green and blue are all 255, so the pixel is white → rgb(255, 255, 255)
Comparing two neighbouring pixels: the first reads rgb(200, 30, 30) and the next reads rgb(198, 32, 31), so they are almost the same colour → rgb(200, 30, 30) and rgb(198, 32, 31)
rgb(300, 20, 40) → The red number is 300, but each RGB number stored for a pixel must be between 0 and 255. An eyedropper would never show 300.
rgb(255, 0) → Only two numbers are given. An eyedropper always shows three numbers for a pixel: red, green and blue.

Key Term

eyedropper
A tool that picks one pixel in an image and shows the red, green and blue numbers (0 to 255) stored for it, such as rgb(255, 0, 0) for pure red.

Fill in the Blanks

1. colour = eyedropper(photo, 40, 25)
Hint: Type the name of the tool that picks one pixel and reads its RGB numbers.
2. rgb(255, 0, 0)
Hint: Type the red number for a pixel that is pure, fully bright red.
3. rgb(255, 255, 0)
Hint: Yellow has full red and full green. Type the blue amount it needs.
4. left = eyedropper(photo, 5, 5) right = eyedropper(photo, 6, 5)
Hint: Type the x position of the pixel directly beside the first one, to compare neighbours.
5. middle = colour.green
Hint: Type the name of the colour channel that is the middle number in rgb().

Spot the Error

Question 1
A pixel = eyedropper(img, 10, 5)
B print(pixel.red)
C print(pixel.yellow)
D print(pixel.blue)
Line C — Line 3 should read the green number. An eyedropper only stores red, green and blue numbers for a pixel, so there is no yellow value. It should be print(pixel.green).
Question 2
A # Eyedropper found pure red
B rgb = (256, 0, 0)
C print(rgb)
Line B — Each RGB number must be from 0 to 255. Pure red is (255, 0, 0), so 256 is out of range. It should be rgb = (255, 0, 0).
Question 3
A a = eyedropper(img, 5, 5)
B b = eyedropper(img, 6, 5)
C if a = b:
D print("Same colour")
Line C — A single = assigns a value. To compare two neighbouring pixels you need the comparison operator ==. It should be if a == b:.
Question 4
A pixel = eyedropper(img, 8, 8)
B black = (255, 255, 255)
C if pixel == black:
D print("Black pixel")
Line B — Black has the red, green and blue numbers all at 0. (255, 255, 255) is white. It should be black = (0, 0, 0).
Question 5
A pixel = eyedropper(img, 1, 1)
B red = pixel.red
C green = pixel.green
D blue = pixel.red
E print(red, green, blue)
Line D — The variable blue is being given the pixel's red number. The blue number is stored in pixel.blue, so the line should be blue = pixel.blue.

Student with a class code? Join your class →