Definition
Zoom into a photo again and again. What do you find in the end?
A digital image is a grid of tiny squares called pixels. Each pixel stores numbers for its colour, usually three numbers for how much red, green and blue light it has. Resolution is the number of pixels in the image.
In simple words
To a computer, a photo is not a cat or a sunset. It is a huge table of numbers. A black-and-white picture can be just 0 for white and 1 for black. A colour pixel might be (255, 0, 0) for bright red. When AI 'sees', it looks for patterns in these numbers.
Why it matters
Face unlock, medical scans, self-driving cars and photo search all start here. Once you know an image is numbers, you can see how a machine can learn that certain patterns of numbers mean 'face' or 'stop sign'.
Key terms
- Pixel
- Short for "picture element": one tiny square of a digital image, holding one colour.
- Resolution
- The number of pixels in an image, usually given as width by height.
- RGB
- Red, green and blue: the three colours of light that screens mix to make every other colour.
- Megapixel
- One million pixels. A 12-megapixel camera takes photos with about twelve million pixels.
- Greyscale
- An image with only shades of grey, so each pixel needs just one number.
- Compression
- Making a file smaller by storing its data more cleverly, sometimes by dropping detail the eye will not miss.
Explained in detail
A picture is a grid of numbers
Look very closely at a phone screen, or zoom far into a photo, and you will see that the image is made of tiny squares. Each square is a pixel, and each pixel shows exactly one colour. From a normal distance the squares are too small to see and blend into a smooth picture. To the computer there is no picture at all, only a long table of numbers describing the colour of each pixel, row by row.
How colour becomes three numbers
Screens make colours by mixing three coloured lights: red, green and blue. Each pixel stores three numbers, one for the brightness of each light, from 0 (off) to 255 (full). Red and green together at full strength look yellow. All three at full strength look white, and all three at zero look black. Because each of the three numbers can take 256 values, a pixel can show more than sixteen million different colours.
A greyscale image is simpler. Each pixel needs only one number, from 0 for black to 255 for white. Many AI systems that read handwriting or X-rays work with greyscale images, because colour adds nothing useful there.
Resolution and file size
Resolution is the number of pixels in an image. A full high-definition screen is 1,920 pixels wide and 1,080 pixels tall, which is about two million pixels. A 12-megapixel phone camera records about twelve million. More pixels capture finer detail, and they also mean more numbers to store: twelve million pixels with three numbers each is thirty-six million numbers for a single photo.
That would make very large files, so images are usually compressed. Compression stores the same picture with fewer numbers, for example by describing a large patch of blue sky once and not pixel by pixel. Some methods also drop tiny details that the human eye does not notice. This is why a photo sent through a messaging app can look slightly rougher than the original.
Video is many images
A video is a series of still images, called frames, shown quickly one after another, usually 24 to 30 every second. Your brain joins them into smooth movement. One minute of video at 30 frames a second contains 1,800 images, which is why video files are so much larger than photos and why AI that studies video needs so much computing power.
What this means for AI
When an AI model looks at a photo of a cat, it receives millions of numbers and nothing else. It has no idea what fur or whiskers are. During training it learns that certain arrangements of numbers, such as the patterns made by pointed ears and round eyes, tend to appear in photos labelled "cat". This explains both its power and its weakness. It can study more images than any person could, but if the lighting or angle changes the numbers too much, the pattern it learned may no longer match.
How it works
| Colour | Red | Green | Blue |
|---|---|---|---|
| Black | 0 | 0 | 0 |
| White | 255 | 255 | 255 |
| Bright red | 255 | 0 | 0 |
| Yellow | 255 | 255 | 0 |
Try it yourself
Build a picture pixel by pixel
Draw on the grid and watch the numbers change. Then mix a colour from red, green and blue.
Common mistakes
- Thinking the computer sees objects. It sees numbers and learns which patterns go with which objects.
- Thinking resolution is the size of the screen. It is the number of pixels in the image.
- Thinking colours are stored as names. They are stored as numbers.
Check yourself
Summary
- A digital image is a grid of pixels.
- Each pixel stores colour as numbers, often red, green and blue.
- AI 'sees' by finding patterns in those numbers.
Finished reading?