VITON13School
Free tools of the school

How does a camera work? Lens, sensor, aperture, shutter and ISO explained

A camera works by letting a lens gather light from a scene and focus it into a sharp image on a light-sensitive surface, today a sensor with millions of pixels. Each pixel counts the photons that reach it through a red, green or blue filter, and the aperture, shutter time and ISO decide how bright and how sharp the picture is. The result is a grid of numbers: three bytes per pixel, so a 12-megapixel photo is 36 million bytes before compression.

By , Founder of VITON13 SCHOOL
A cutaway Nikon F SLR camera with a 50 mm f/2 lens: lens elements on the left, the tilted mirror and viewfinder prism above, seen from the front left

Behind every photo is the same idea as a dark room with a tiny hole in one wall. Below you will see why a pinhole makes an upside-down picture, what a lens adds, how a sensor counts light and finds colour, how three dials trade brightness against blur, and how a photograph ends up as numbers.

Key ideas

  • A pinhole draws an upside-down picture because light travels in straight lines. A lens gathers far more light and still keeps the picture sharp.
  • The thin-lens rule 1 / f = 1 / u + 1 / v gives the focus. With f = 50 mm and a subject 2 m away, the lens sits 51.3 mm from the sensor, 1.3 mm out from its position for a distant subject.
  • A sensor counts photons in millions of pixels. A Bayer filter, patented in 1976, gives each pixel one colour, two green for every red and blue, and the camera works out the rest.
  • Aperture, shutter and ISO trade against one another: one f-stop halves the light, and doubling ISO doubles the brightness and the noise.
  • A photo is a grid of numbers: three bytes per pixel, 16,777,216 colours, and a 12-megapixel photo is 36 million bytes before JPEG squeezes it to 3 or 4 MB.

The dark room with a hole

Camera obscura is Latin for dark room. Make a small hole in the wall of a dark room, and on the opposite wall appears an upside-down picture of the world outside. The reason is that light travels in straight lines: rays from the top of a tree pass through the hole going downwards and land low on the wall. The Chinese thinker Mozi wrote about it in the 5th century BC, and Ibn al-Haytham explained it in his Book of Optics around 1021.

A smaller hole gives a sharper but dimmer picture. The first permanent photograph was taken by Nicéphore Niépce around 1826, and the exposure took many hours. That is the problem a lens solves.

[1]

A lens is a thousand holes

A lens bends light so that all the rays leaving one point of an object meet again at one point behind it. It gathers far more light than a pinhole and still keeps the picture sharp. The distances follow the thin-lens rule 1 / f = 1 / u + 1 / v, where f is the focal length, u the distance to the subject and v the distance from lens to sensor. A bigger opening collects more light, so the picture can be taken in less time.

Take a lens with f = 50 mm and a subject 2 m away, which is 2,000 mm. Then 1 / v = 1 / 50 − 1 / 2,000 = 39 / 2,000, so v ≈ 51.3 mm. A very distant subject would need v = 50 mm. To focus on the nearer subject the lens moves 1.3 mm away from the sensor. Focusing is moving a lens by about a millimetre, and a phone does it with a tiny motor.

The photo is a cutaway of a Nikon F camera with a 50 mm f/2 lens, in the Nikon Museum in Tokyo. On the left you can see the lens elements, in the middle the tilted mirror that sends the image up to the viewfinder prism, and behind it the place where film or a sensor sits. When the shutter is released the mirror flips out of the way.

A million buckets of light, and colour from a mosaic

The sensor is a chip covered with millions of tiny light-sensitive cells, the pixels. A particle of light, a photon, hitting silicon knocks an electron loose. Each pixel counts the electrons it collects, like a bucket collecting rain. Most sensors today are CMOS. The CCD, invented by Willard Boyle and George Smith in 1969, earned them a share of the Nobel Prize in Physics in 2009. A 12-megapixel sensor has 12 million pixels, for example 4,000 columns and 3,000 rows. On a full-frame sensor, 36 mm wide with 6,000 columns, each pixel is 6 micrometres across.

A bucket can count light but cannot tell its colour. So each pixel sits under a tiny red, green or blue filter, in a pattern invented by Bryce Bayer at Kodak and patented in 1976. In every block of four pixels there are two green, one red and one blue. Green gets twice the room because human eyes are most sensitive to green. The camera then estimates the two missing colours at every pixel from its neighbours, a step called demosaicing.

Aperture, shutter and ISO

The aperture is the adjustable opening in the lens. It is written as an f-number N, the focal length divided by the opening’s diameter. A 50 mm lens at f/2.8 has an opening of about 18 mm. Each full step of the series f/2.8, f/4, f/5.6 halves the light, because the area of the opening halves. A wide opening, a small number, gives bright pictures and a blurred background. A narrow opening gives dimmer pictures with more of the scene sharp.

The shutter decides how long light is collected, for example 1/100 s. A long time makes pictures brighter but turns fast movement into blur. ISO amplifies the signal after the light is counted: doubling ISO doubles the brightness, and also the noise.

The three dials trade against each other. Going from f/2.8 to f/5.6 is two steps, a quarter of the light, so to keep the same brightness 1/100 s must become 1/25 s, four times longer. Photographers choose which of the three to give up: depth, sharpness of motion or low noise.

A photograph is numbers

Each pixel stores three numbers, for red, green and blue, from 0 to 255, one byte each. That gives 256 × 256 × 256 = 16,777,216 colours. White is (255, 255, 255), black is (0, 0, 0) and pure red is (255, 0, 0). A 12-megapixel photo is 12 million × 3 bytes = 36 million bytes before compression. JPEG squeezes it about ten times, to 3 or 4 MB, by dropping detail the eye hardly notices. Raw files usually keep 12 or 14 bits per colour instead of 8.

A phone camera follows the same chain, with a lens a few millimetres across and a small sensor. Its software often combines several quick frames into one picture, so part of what you see is calculated. A photo is a spreadsheet of numbers, and editing it is arithmetic.

How the VJOURNAL SMART BOOK shows it

The chapter “The camera” in the VJOURNAL SMART BOOK “How it works”, Volume I, has five animated moments: a pinhole draws an upside-down picture of the world, a lens gathers much more light and brings it into focus, the sensor counts light through red, green and blue filters, aperture, shutter and ISO set brightness and blur, and the photo turns into a grid of numbers. A 3D model plays the exact moment that the text block describes.

Under the picture is a sandbox. Move the aperture, shutter and ISO sliders and watch brightness and blur change. The chapter also has key facts, a three-question quiz with explanations and the sources.

[2][3]

In everyday language

A camera is a dark box with a window. The lens lets in a lot of light and still draws a sharp picture on the back wall, and the sensor is that wall, made of millions of tiny buckets that count how much light fell into each one.

Try it yourself

A 50 mm lens focuses on a subject 1 m (1,000 mm) away. Use 1 / f = 1 / u + 1 / v to find the distance v from lens to sensor, and how far the lens moves out from its position for a distant subject (v = 50 mm).

Expected result

1 / v = 1 / 50 − 1 / 1,000 = 19 / 1,000, so v ≈ 52.6 mm. The lens moves out by about 2.6 mm.

Check your answer: You change from f/4 at 1/200 s to f/8 and want the same brightness. What shutter time do you need?

f/4 to f/8 is two steps, so the light falls to a quarter. The shutter must stay open four times longer: 1/50 s.

Questions

How does a camera focus?

A small motor moves the lens, or part of it, by about a millimetre until the image falls sharply on the sensor. Autofocus decides how far by measuring contrast or phase differences in the incoming light.

What is the difference between a DSLR and a mirrorless camera?

A DSLR has a mirror and a prism that send the image to an optical viewfinder, and the mirror flips up during exposure. A mirrorless camera has no mirror and shows the sensor’s image on a screen or an electronic viewfinder. Both have a lens and a sensor.

What do aperture, shutter speed and ISO do?

Aperture sets how wide the lens opens, shutter speed sets how long light is collected, and ISO sets how much the signal is amplified. Together they decide brightness, and separately they control blur of the background, blur of motion and noise.

What are megapixels?

One megapixel is a million pixels. A 12-megapixel sensor has 12 million, for example 4,000 by 3,000. More pixels give finer detail, but each one can then collect less light.

Why does the sensor need a colour filter?

A pixel only counts how much light reached it, not its colour. A Bayer filter puts a red, green or blue filter over every pixel, and the camera estimates the other two colours from neighbouring pixels.

How is a phone camera different?

It works the same way, with a very small lens and sensor. To make up for the little light they collect, phone software often merges several frames and processes the result, so the final picture is partly computed.

Remember three lines: a lens focuses light onto a sensor, colour filters turn counts into colour, and aperture, shutter and ISO trade brightness against blur. Then open the chapter and move all three sliders in the sandbox.

Sources and further reading

  1. Nobel Prize: Physics 2009, the CCD sensor and fibre optics ↗Sources checked:
  2. Britannica: Camera obscura ↗Sources checked:
  3. Britannica: Camera ↗Sources checked:
  4. Bayer, B. E.: Color imaging array, US patent 3,971,065 (1976) ↗Sources checked:
  5. Cambridge in Colour: Digital camera sensors ↗Sources checked: