TwiddleLab / Artificial Intelligence / How Machines See and Hear
A Picture Is a Grid of Numbers
What you will learn
- A digital picture is a grid of pixels, and each pixel is stored as a number.
- In a gray picture, 0 is black and 255 is white. A 32 × 32 picture is 1,024 numbers.
- Resolution is how many pixels across and down.
- A color pixel is three numbers: how much red, green and blue light to mix.
How the lesson goes
Your phone takes a picture of a critter. What does the computer actually get?
Guess how many numbers this small photo turns into. Drag the marker, then Check.
Zoom in on the critter's left eye.
Keep going until you see what the computer sees.
Find the brightest pixel in this patch and tap it.
Then Check.
Brightness is stored as a number from 0 (no light, black) to 255 (full light, white). The highest number in the patch is the brightest pixel.
These are the words for what you just saw.
Tap to reveal them.
Each tiny square is a pixel, short for picture element.
Each pixel stores its brightness as a number: 0 is black, 255 is white.
How many pixels across and down is the resolution. This picture is 32 × 32.
To a computer, a picture is nothing but this grid of numbers.
Make your own icon, 8 pixels by 8.
Pick a shade and paint. Watch the numbers on the right: that's all a computer will ever store.
Game: color match. Mix three colors from red, green and blue light.
A color pixel is three numbers. Move the sliders until your square matches the circle.
Your icon was sent to a friend. Only these numbers arrived. Which picture will their phone show?
Tap a picture, then Check.
Each number tells one pixel how bright to be, row by row from the top left. Read the rows in order and the picture rebuilds itself.
Next lesson: Filters Find Edges · Part of the course: How Machines See and Hear
Lessons are interactive and need JavaScript. Turn it on to play them.