Tech●●●●●Difficulty 1 of 5

How does a computer store a photo using only 0s and 1s?

The first digital photo, in 1957, was a baby made of 30,976 black-or-white squares. Your phone uses the same trick with three numbers per square.

▶ Start the story

A computer stores a photo as a grid of numbers. It chops the picture into tiny squares called pixels, like a mosaic, and records the colour of each one as three numbers: how much red, how much green and how much blue light to mix. Each number runs from 0 to 255, which is exactly what one byte of eight 0s and 1s can hold. Three bytes per pixel, 24 bits in all, and the whole photo becomes a long string of binary.

Why red, green and blue? Because of your eyes. Screens mix coloured light, and our eyes have three kinds of colour-sensitive cells, so three well-chosen lights added together in different amounts can fool them into seeing a huge range of colours. With 256 levels for each of the three, there are 16,777,216 possible combinations.

It started much more modestly. In 1957, the engineer Russell Kirsch and his team built one of the first image scanners and fed it a photo of his three-month-old son. The result was a grid of 176 by 176 pixels, 30,976 in all, and each pixel was a single bit: pure black or pure white, no greys, let alone colours. It was one of the first digital photographs, and in 2003 Life magazine named it one of the 100 photographs that changed the world.

Grainy black-and-white square image of a baby's face, made of visible square pixels.
One of the first digital photographs: Russell Kirsch's son, scanned in 1957 as a 176 × 176 grid of pixels.Photo: Russell A. Kirsch · Public domain

Every picture on your phone is the great-grandchild of that baby portrait: the same grid, just with far more pixels and three bytes of colour in each.

Quiz me

0/3

  1. 1.How are images structured inside a computer's memory?
  2. 2.What does an RGB triplet represent in digital imaging?
  3. 3.Why are component values in computers often stored in the range of 0 to 255?

Recap

A photo is a grid of pixels, and each pixel is three bytes: red, green and blue.

Surprising fact · With 8 bits per colour, a pixel can take 16,777,216 different colours.

Sources (3)

No source, no claim. Every fact in this lesson (15 claims) cites at least one of these.

  1. [2]RGB color model · Wikipedia
  2. [4]Pixel · Wikipedia
  3. [5]Russell A. Kirsch · Wikipedia
More lessons in 💻 Tech (3) See all tech lessons →

One more light on your map.

Get one lesson like this every day, about the things you love. Free, in two or five minutes.

Get the share card for this lesson ↗