How a camera lens works
How a piece of glass turns light into a photograph: why you need a lens, how it focuses, and what the aperture and the focal length do. Every figure is live: turn the rings, drag the cat and the focal points.
Inside the lens
Let’s start with what is inside. This is a standard 50 mm f/2 lens built on the classic double Gauss design: six elements in four groups, like the famous Planar and the Soviet Helios‑44. You can turn the model, cut it in half and take it apart. The rays on it are not drawn by eye: their paths are traced through all ten glass surfaces.
Turn the focus ring: the optical block moves forward, and the rays from a close object meet on the sensor again. Close the aperture, and the beam of light gets narrower. The six elements work as one: they bring the rays from every point of the scene back together at a point on the sensor. Everything else in the lens is there to hold the glass precisely in place and to move it. Step by step, let’s see why this works at all.
The dark room
Every point of the cat’s fur scatters light in all directions: rays from the tip of its ear fly up, down and straight at you. Put a bare sensor in front of the cat, and every pixel receives light from every point of the cat, the sky and the grass at once. You get an even glow, not a picture.
The simplest way to bring order is to hide the sensor in a box and make a small hole in its wall. Now only a thin bundle of rays from each point of the cat gets in, and it lands in its own spot on the back wall. Rays from the ear go down through the hole, rays from the paws go up, so the image is upside down. This is a camera obscura, Latin for “dark room”.
This is the central trade-off of the camera obscura. For a sharp picture the hole has to be tiny, which lets in very little light, so exposures take seconds or minutes. A hole that is too small does not work either: light starts to bend around its edges and the picture gets blurry again. This is diffraction.
We need something that lets a wide beam of light through and still brings it together at a single point. Click “Insert a lens” in the figure: the hole can be opened wide and the image stays sharp.
Glass bends light
Light travels about one and a half times slower in glass than in air. This ratio is called the refractive index n. When a ray enters glass at an angle, it changes direction: it refracts. Snell’s law links the angles: n₁·sin θ₁ = n₂·sin θ₂. The angles are measured from the normal, the line perpendicular to the surface.
A lens is glass with curved surfaces. Near the edge of a convex lens the surface is tilted more than in the center, so the outer rays bend more than the central ones. As a result a parallel beam comes together at a single point, the focus.
Turn up the curvature: the outer rays cross the axis closer than the central ones. A spherical surface does not focus perfectly; this is spherical aberration. Switch on “White light”: blue rays bend more than red ones. We will come back to both flaws at the end.
A concave lens does the opposite and spreads the rays apart. Lenses like that are found in camera lenses too: they correct the flaws of the converging ones.
How a lens forms an image
The distance from the lens to the point where parallel rays meet is the focal length f. It is the defining property of a lens.
To find where the image forms, three rays from the tip of the ear are enough. A ray parallel to the axis passes through the rear focal point F′ after the lens. A ray through the center of the lens does not bend. A ray through the front focal point F leaves parallel to the axis. Where they meet is the image of the ear. Every other ray from the ear that passes through the lens arrives there too.
Move the cat far away: the image moves toward the focal point and gets small. This is how a camera works: subjects are usually far away, and the sensor sits just beyond the focal length. Bring the cat closer than two focal lengths, and the image becomes larger than the cat itself; this is what macro photography relies on.
Put the cat inside the focal length, and the rays diverge after the lens: there is no real image. But if you look through the lens, you will see a magnified, upright cat. That is a magnifying glass.
Focusing
In a camera the sensor does not move. Yet by the lens equation, the image of a close object forms farther from the lens than the image of a distant one. To get a sharp cat, the lens has to sit at the right distance from the sensor. That is focusing: the focus ring moves the glass forward or back, by just a few millimeters.
If the sensor is not where the rays meet, it cuts the cone of light before or after its tip. Instead of a point you get a disc, called the circle of confusion. Many such discs overlapping each other make a blurry picture.
Autofocus does the same on its own: it moves the glass until the picture has the most contrast, or until phase-detection sensors report that the rays meet on the sensor.
Aperture
Inside the lens there is an iris diaphragm: a few thin blades that form an opening of adjustable size. The size is given as the f-number N = f / D, where D is the diameter of the opening. On a 50 mm lens at f/2 the opening is 25 mm across; at f/8 it is only 6.25 mm.
The sequence 1.4 — 2 — 2.8 — 4 — 5.6 — 8 — 11 — 16 — 22 is no accident. Each number is √2 times the previous one, so the area of the opening halves and half as much light gets through. Such a step is called a stop.
The aperture has a second effect. The narrower the opening, the narrower the cone of light behind the lens, and the smaller the blur circle of everything out of focus. And the blur circle takes the shape of the opening: that is where hexagonal or round spots of out-of-focus lights come from. They are called bokeh.
Depth of field
Strictly speaking, only one plane is sharp: the one the lens is focused on. But the eye cannot tell a small enough blur circle from a point. For a full-frame sensor the usual limit is 0.03 mm, about 1/1500 of the frame diagonal. Anything with a smaller circle counts as sharp. The zone between the near and far limits of sharpness is called the depth of field.
Depth of field depends on three things: the aperture (the higher the f-number, the deeper the zone), the distance to the subject (the farther, the deeper) and the focal length (the longer, the shallower).
Focus on the cat at f/1.4, then close the aperture to f/16: the background emerges from the blur. That is why portrait photographers love fast lenses, while landscapes are shot at f/8–f/11.
Focal length
The focal length decides how large the image will be. Look at the sensor from the center of the lens: the angle at which you see its edges is the angle of view. The farther the lens is from the sensor, that is, the longer f, the narrower the angle and the larger things appear in the frame.
On a 36×24 mm full-frame sensor a 50 mm lens covers about 40° horizontally. Lenses of 14–24 mm are called wide-angle, 85–135 mm portrait lenses, and from 200 mm up, telephoto.
Switch on “Keep the cat the same size”. The camera backs away while the focal length grows, so the cat stays the same size while the background spreads out or closes in. This is called perspective compression. In fact, perspective depends only on where you shoot from; the focal length merely chooses how much of the view to crop.
Why a lens has so many elements
A single lens never focuses perfectly. Light of different colors bends by different amounts: blue more, red less. This is dispersion. A single lens puts the blue focus closer than the red one, and colored fringes appear on high-contrast edges: chromatic aberration. On top of that comes spherical aberration: the outer rays focus closer than the central ones.
The fix is a combination of glasses. An achromatic doublet cements a converging lens of crown glass (low dispersion) to a diverging lens of flint glass (high dispersion). The flint barely weakens the focusing, but it spreads the colors the opposite way and brings the red and blue foci back together.
Real lenses have 6 to 20 elements. Some are aspherical, some are made of extra-low-dispersion glass. Each element corrects the errors of the others, and together they behave almost like the ideal thin lens we started with.
All together
Now the whole lens is in your hands: zoom, focus and aperture. Frame the shot, click the photo to focus, and take pictures: they will appear on the film strip below together with the settings.
Switch the sensor to a smartphone one. To get the same framing you need a lens several times shorter, and at the same f-number the background barely blurs at all. That is why phones blur the background in software.