LENS / OPTICS

How a Lens Works

Try it yourself

01 / INTERACTIVE / THIN LENS

A Moving Lens Group Focuses Light on a Fixed Sensor

Thin-lens ray diagramPersonUpper: red, solidLower: blue, dashed
Thin-lens ray diagramA ray diagram showing red light from the upper point and blue light from the lower point of the person or mountain being limited by an internal aperture, refracted by the moving lens group, crossing vertically and converging at inverted image points for each subject, while the fixed sensor intercepts each bundle before convergence or after it has crossedMountainPersonFFReflected light spreadsRefraction at lens groupSubject image pointMoving lens groupFixed sensorImage pointFixed-sensor image visualizationAn inverted sensor image in which the person and mountain share one line of sight, are blurred by the separate circles of confusion they form on the fixed sensor, and the person has a warm-white outlineFixed-sensor image visualization36 × 24 mmTop-bottom invertedFocusing: the lens group moves forward or backward (visually enlarged)
Focus on

This thin-lens model compares lens imaging with pinhole imaging. The sensor—the image-recording plane—stays fixed while the lens group moves forward or backward to set the focus distance. Light spreading from one object point converges at that subject’s image point. When the point falls in front of or behind the sensor, the bundle has a finite width on the sensor and forms a circle of confusion.

What is happening nowThe Person circle of confusion is 0.000 mm. Image point meets sensor: in focus.Red light from the person’s upper point converges below, while blue light from the lower point converges above, producing an inverted image. Lens travel, image-point displacement and projected blur are enlarged in the diagram so the difference is visible. The numerical values still follow the thin-lens calculation.
Person 0.000 mmMountain 0.225 mm
Sensor remains fixed
Fixed
Lens group to fixed sensor
50.63 mm · +0.63 mm
Effective aperture diameter
17.9 mm
Selected circle of confusion
Person · In focus · Image point meets sensor: in focus
The spacing between the person and mountain is compressed, and the sensor view overlaps them on one line of sight to show foreground and background schematically. The sensor remains fixed; focusing moves the lens group forward or backward. Focal-length changes are represented as changes in the curvature and optical power of an equivalent lens. A longer focal length enlarges both images but does not change their perspective relationship while the camera position stays fixed. The aperture sits inside the lens group and limits the transmitted bundle, with f/1.4 treated as fully open. The subject image points and circles of confusion on the fixed sensor follow the thin-lens calculation. Screen blur converts each circle to a Gaussian effect; real compound-lens construction, aberrations and diffraction are not reproduced. Tolerance 0.03 mm How lenses work: Canon Science Lab for Kids · How cameras and focusing work: Canon Science Lab for Kids · Thin-lens and depth-of-field reference: MIT Computational Photography

A lens refracts spreading light and brings it back to a point. Where a pinhole restricts which directions can pass, a lens bends light and gathers it. That single difference decides brightness, focus and blur. On this page you can move focal length, f-number and focus distance yourself and watch the image change.

Focal length, f-number, focus distance and the distance to the person can be combined freely. In the ray diagram, red rays from the top of the person and blue rays from the bottom pass through the same lens, swap over and converge at the image point. Take focus away and you can see the bundle cross in front of the sensor and spread again, or still be closing when it arrives.

How a lens works: a 3D explanation

4:46 · No audio

Follow reflected light through refraction and image formation in 3D. The video shows focusing on a tree and mountain, aperture, focal length, the image circle and sensor, then compares pinhole projection of sunlight.

This video has no audio. Its visual content and movements are also described in the text below. Read the article explanation

Read the video’s visual description

Light reaches a point on the tree’s surface and reflects in many directions. The portion reaching the lens is refracted and brought together. Light from each point forms its own small image point; together these produce an inverted tree on the sensor.

When the tree is in focus, light from one of its points comes together at the sensor. Light from the distant mountain crosses before reaching the sensor and then spreads again, blurring the mountain. The diagram distinguishes the tree’s and mountain’s image positions from the sensor plane.

The lens moves while the sensor stays fixed, bringing the mountain’s image position onto the sensor. The mountain becomes sharp. Light from the tree now reaches the sensor before converging, so one tree point makes a large circular blur. Focusing changes which subject distance appears sharp.

The animation separates the tree’s rays from the mountain’s and narrows the diaphragm. A narrower transmitted bundle makes a smaller blur circle on the sensor for an out-of-focus point. The diaphragm changes the range of admitted rays, rather than moving the ideal image position.

A schematic lens changes curvature to show the relationship between light bending, focal length, image size and field of view. Less pronounced curvature gives weaker bending and a longer focal length. This illustrates an optical relationship; it does not mean that the glass in a real zoom lens changes shape.

A moving three-dimensional view shows that only the light directed toward the opening enters the lens. The circular area over which the whole scene can be imaged is the image circle; the image does not extend equally beyond it. This overall image area is different from the circle of confusion, which describes the blur from one point.

A rectangular sensor outline is placed over the image circle, and only its interior is recorded. As the rectangle grows beyond the circle, its corners become dark. Light paths, lens travel, image positions and blur are schematic representations made easier to see, not the literal construction or dimensions of a real camera.

The final scene returns from a lens to a pinhole. Sunlight travels straight through a small opening and illuminates the inside of a box. As the sun’s direction changes, the illuminated position and surface change. Observe the projected light inside the box; never look directly at the sun or at it through the opening.

02 / CONVERGENCE

A lens gathers light

Light leaves a single point on an object in every direction. Of that spreading light, only the part that reaches the lens is refracted, changes direction and converges again at one point. That point is the image point.

A pinhole does not bend light. A small opening forms an image by limiting which directions can get through. It restricts rather than gathers. That is why a pinhole is dark and a lens is bright: both form an image, but on fundamentally different terms.

Light through a lens converges to a point only when certain conditions are met. Away from them the bundle never quite closes, and it still has width where it lands. That width is what we call blur.

03 / FOCAL LENGTH

What focal length means

Light arriving from infinity — effectively parallel rays — converges to a single point behind the lens. The distance from the lens to that point is the focal length. With a 50 mm lens, parallel light comes to a point 50 mm behind it.

The longer the focal length, the larger the image of the same subject. That is how a telephoto lens enlarges distant things. One caution: changing focal length does not change perspective itself. From the same camera position, the relationship between near and far stays the same; only the field of view changes.

Focal length can also be read as the strength of the lens's refractive power. A short focal length bends light strongly; a long one bends it gently.

04 / APERTURE

F-number and aperture

The f-number is the focal length divided by the effective aperture diameter. At f/2.8 the effective diameter is one 2.8th of the focal length. A smaller number means a wider opening and more light passing through.

At the same f-number, the brightness at the image plane stays roughly the same even when focal length changes. That is precisely why the f-number is defined as a ratio: it was designed to be a useful figure when setting exposure.

Stopping down — raising the f-number — narrows the bundle of light passing through the lens. A narrow bundle spreads over only a small area even on a plane that misses the image point. That geometric fact is why stopping down appears to widen the zone that looks sharp.

05 / FOCUS

Focus and the circle of confusion

As subject distance changes, so does the position of the image point: the closer the subject, the further back the image point moves. The sensor or film stays where it is, so the two fall out of alignment.

Focusing is the act of bringing that image point onto the recording surface. In an ordinary camera this is done by moving the lens group back and forth, not by moving the sensor. The model at the start of this page works the same way: the sensor is fixed and the lens group travels.

When the image point misses the recording surface, the light arriving there has either not yet closed to a point or has already crossed and begun to spread again. In both cases it lands as a circular patch. That patch is the circle of confusion, and the smaller it is, the sharper that subject looks.

06 / DEPTH OF FIELD

Why depth of field changes

Strictly speaking, the image point coincides with the recording surface at exactly one distance. But if the circle of confusion is small enough, the eye reads it as sharp. The range over which that judgement holds is the depth of field.

Depth of field depends on the aperture, the focal length, the subject distance and the size of circle of confusion you are willing to accept. Stopping down, using a shorter focal length or moving the subject further away all widen the range; opening up, using a longer focal length or moving closer all narrow it.

Depth of field is therefore not a property belonging to a lens. It is the outcome of a combination of conditions. Move the four controls in the model at the start of this page and the circle of confusion for the selected subject changes as you go.

07 / VS PINHOLE

How this differs from a pinhole

A pinhole camera has no focus in the sense a lens does. Light through the opening travels straight rather than bending, so near and far are projected alike. The idea of depth of field is simply not needed.

Instead, the size of the opening itself sets how soft the image is. A larger hole lets light from one point reach a wide area of the image plane, where it overlaps neighbouring points and blurs. A smaller hole tightens it, but admits less light and lengthens the exposure; too small, and diffraction softens it again.

A lens developed toward gathering light to make images bright and sharp; a pinhole developed toward restricting light so that an image holds at all. Neither is superior. They set the conditions for an image differently.

The apparatus used to photograph THE MOST BEAUTIFUL LIGHT NEXT TO THE DARK
Lightweight camera for THE MOST BEAUTIFUL LIGHT NEXT TO THE DARK, 2014

08 / REFERENCES

References

Read next