Images are numbers
This sheet is 144 numbers. Colour them in and a picture appears. That's all a photo ever was.
- Turn numbers into a picture
- Work out resolution and megapixels
- Mix colours from red, green and blue
Images are numbers
This sheet is 144 numbers. Colour them in and a picture appears. That's all a photo ever was.
- Turn numbers into a picture
- Work out resolution and megapixels
- Mix colours from red, green and blue
Story
apple-pixels.csv.she messages.
Learn it
A computer never sees an apple. It sees a grid of numbers: one number per pixel in a grayscale photo, three in a colour one. Colour them in and the picture appears; change a number and the picture changes. Everything computer vision "understands" is arithmetic on these numbers, so this lesson is the foundation for the whole unit.
Words to know
picture element: the smallest unit of a digital image.
the number of pixels, written width × height, like 1280 × 1024.
a million pixels. 1280 × 1024 = 1,310,720 ≈ 1.3 megapixels.
the number stored for a pixel. In grayscale, one number from 0 (black) to 255 (white); everything between is a shade of grey.
8 bits. One byte can hold 2⁸ = 256 values, which is why pixel values run 0 to 255.
a colour image: each pixel is three numbers, how much Red, Green and Blue, each 0–255.
Step by step: a tiny picture and a real photo
A 4 × 4 grayscale picture:
0 0 0 0
0 255 255 0
0 255 255 0
0 0 0 0
- Read it: 0 is black, 255 is white, so it is a white square in a black frame.
- Count pixels: 4 × 4 = 16.
- A real phone photo: 4000 × 3000 = 12,000,000 pixels = 12 megapixels.
- Its size: in grayscale, 1 byte per pixel = 12 million bytes (about 12 MB). In RGB, 3 bytes per pixel = 36 million bytes.
- Mixing colours: (255, 0, 0) is red; (0, 0, 255) blue; (255, 255, 0) yellow; (128, 128, 128) mid-grey; (0, 0, 0) black; (255, 255, 255) white.
Careful: more megapixels do not always mean a better photo. They mean more pixels, not better light, focus or lens. And in a grayscale image 0 is black, meaning no light, and 255 is white.
Your missions
datasets/apple-pixels.csv · Thonny (Finished early)Numbers into a picture
10 minin pairs- 1
Open
apple-pixels.csv. Make every column narrow and every row the same height, so the cells are square. - 2
Predict: looking only at the numbers, where is the stem? Write the row and column.
Only you can see this - 3
Select all 144 cells → Format → Conditional → Color Scale. Set the lowest value to black and the highest to white. What appears?
- 4
Change one number from 70 to 235. What happened to the picture? Change it back.
Resolution
7 min- 5
In a new sheet: this image is 12 × 12. How many pixels?
- 6
A phone camera takes photos 4000 × 3000. How many pixels? How many megapixels?
- 7
In grayscale each pixel takes 1 byte. How many bytes is the phone's photo? And in RGB, with three bytes per pixel?
Three numbers make a colour
6 min- 8
Click any cell → Format Cells → Background → Pick a Color. Type R, G and B values to make: chinar red, saffron, Dal Lake blue. Write down the three numbers for each.
- 9
Predict the colour before you try: (255, 255, 0)? (0, 255, 255)? (128, 128, 128)?
Only you can see this
In Thonny, open programs/pixels.py (save it next to apple-pixels.csv).
Predict what it prints, then run it. Change the symbols so the apple prints the other way round —
light where it was dark.
No laptop today?
Your teacher draws a 6 × 6 grid on the board with numbers. Everyone copies it on squared paper and shades each square — the darker the number, the darker the pencil. Then work out the megapixels of a 4000 × 3000 photo together.
Debate it
A photo of your face is, to a computer, a grid of numbers — and so is every photo on every phone in the valley.
- If a photo is only numbers, can a copy of it be told apart from the original? What does that mean for photos shared online?
- Why might this make a face a kind of data that needs protecting, like a phone number?
Check yourself · practice, not a test
In the app, students answer these one at a time and each answer is checked straight away. It's practice, never a mark — anything they miss comes back later for another go.
1.In a grayscale image, what does a pixel value of 0 mean?
- AWhite
- BBlack
- CRed
- DTransparent
2.A photo 4000 pixels wide and 3000 high has 12 ______ pixels.
3.A colour pixel in an RGB image is stored as three numbers.
TrueFalse4.Why do pixel values stop at 255?
- A255 is the brightest colour there is
- BOne byte (8 bits) can store 256 values: 0 to 255
- CCameras can't measure more
- DIt's a CBSE rule
5.Match each RGB value to its colour:
- (255, 0, 0)
- (0, 0, 0)
- (255, 255, 255)
- (255, 255, 0)
- Yellow
- Black
- White
- Red
A picture is a grid of numbers. Change the numbers, change the picture.
Typing practice
Skill: numbers and commas (5 min)
-
On typing.com: the numbers lessons.
-
Type three times, eyes on the screen:
235,235,70,70,150,150,70,70,235,235,235,235 -
Goal this term: 38–44 WPM at 95%.
Written and designed by Faizan Ayoub. © 2026 Faizan Ayoub. All rights reserved.