Three coloured boxes, one camera. Change the light you collect, choose what stays sharp, then follow the rays to see why.

Open the aperture, then shift focus between the boxes. Watch the fine lines sharpen at the selected distance. Increase ISO to see the grain. The boxes stay still, so shutter speed adds no subject motion blur.
Generated illustration; distances and depth blur are illustrative. Simplified image preview: brightness responds; depth blur needs WebGPU.
Light passes through the lens, iris and shutter before it reaches the sensor. Hover over a part, or pick one below, to see what it does.
Change the opening, the exposure time, or the ISO. Compare equal-brightness settings, then choose which box stays sharp.
Preview brightness is held steady. Grain changes only with ISO. Turn off to see your settings’ exposure.
Ready to release the teaching shutter.
A reference exposure: f/4, 1/125 s, ISO 100.
The glass bends light. Overlapping metal blades change the aperture: the opening that sets the width of the light cone. Move the control to see the iris and the rays change together.
The nine-blade iris drawn here is schematic. In the experiment below, the computed pupil is a circle unless you choose an area-matched six- or nine-sided stop; the drawn opening, ray acceptance and footprints then share that exact shape.
Each point in the scene sends a cone of light into the lens. The lens bends every ray toward one image point. The sensor sits at one distance, so it slices each cone: at the tip for the focused subject, and across the cone for everything nearer or farther. The iris decides how wide those cones are.
Play the guide, step through it, or explore with the controls below. Timing is illustrative, not the speed of light.
| Point | Ideal image | Where rays meet | At f/2 | At f/2 | At f/8 |
|---|---|---|---|---|---|
| Foreground · 1 m | 52.631579 mm | 1.350 mm behind the sensor | 0.641026 mm | 0.641026 mm | 0.160256 mm |
| Subject · 2 m | 51.282051 mm | On the sensor | 0 (a point) | 0 | 0 |
| Background · 6 m | 50.420168 mm | 0.862 mm before the sensor | 0.427350 mm | 0.427350 mm | 0.106838 mm |
Every ray the lens accepts from the subject is sent to the same image point, and the sensor sits exactly there. Closing the iris removes some of those rays, but the rest still arrive at that point. In this geometric model the subject’s image has zero size at every aperture.
The 6 m point’s rays meet 0.862 mm before the sensor and spread again; the 1 m point’s rays would meet 1.350 mm behind it. The sensor records each cone’s cross-section. Its diameter is the pupil diameter times the fractional miss, c = D·|1 − s/v|, so f/2 → f/8 shrinks it to one quarter.
A smaller pupil collects less light: f/8 admits 1/16 of f/2’s light at the same shutter time. “Normalize brightness” compensates, as a longer exposure would; “Show light loss” keeps it. With a polygonal pupil, an out-of-focus footprint takes the pupil’s shape, and it is inverted on the side of focus where the rays have crossed.
Geometric rays say an exactly focused point lands on a point. Light is a wave, so even an ideal lens spreads it into a central spot surrounded by faint rings. These panels use the ideal circular-pupil model at 550 nm, all on the same 60 µm window.
Stopping down narrows geometric defocus, but spreads the diffraction pattern. The first-dark-ring diameter is 2.44 λN: 2.684 µm at f/2, 10.736 µm at f/8 and 21.472 µm at f/16. Compare those micrometres with the 0.43 mm (430 µm) background disc at f/2 above.
Intensity is the ideal Airy pattern, [2J₁(v)/v]² with v = πr/(λN), for an unobscured, uniformly lit circular pupil in the infinity-conjugate reference. Each panel is scaled to its own peak and shown with a square-root brightness curve so the rings are visible; brightness therefore does not show exposure. At equal collected light the peak irradiance at f/8 is 1/16 of f/2’s, and at f/16 it is 1/64.
The dashed circle marks the conventional 2.44 λN diameter. At the 2 m focus used above, this thin-lens model’s working f-number is N·v/f, which enlarges each pattern by a factor of 1.0256. The pixel grid is a chosen 4 µm example, not a particular camera.
This is a separate reference. Adding an Airy diameter to a geometric blur diameter would not give a physical point-spread function; that needs the pupil’s phase and a wave-propagation calculation, which this page does not claim.
Ideal thin lens with focal length f = 50 mm and its stop at the lens plane, so the entrance pupil diameter is D = f/N. An object point at distance u has its image at v = fu/(u − f). A ray from object point O through pupil point P reaches a plane z behind the lens at P + (I − P)·z/v, with image point I = −(v/u)·O. Every accepted ray is computed this way; closing the iris only removes pupil points.
At the sensor distance s the footprint is the pupil shape scaled by (1 − s/v): diameter c = D·|1 − s/v|, inverted where the scale is negative. The microscope samples 65,536 fixed, uniform-area pupil points over the f/1.4 pupil and keeps those inside the stop. Diffraction, aberrations, vignetting and sensor sampling are excluded from this geometric model.
The sensor and the subject stay still. Only the lens carriage moves along its rail. Watch where the cone of light comes to a point, then move the lens until that point lands on the sensor.
The subject moves metres; near the sensor, the image moves fractions of a millimetre for distant subjects and many millimetres for close ones.
Outside the blur tolerance. The image point is 0.316 mm (316 µm) behind the sensor; the blur diameter is 0.154 mm. Move the lens 0.317 mm toward the subject to focus.
A near subject sends rays into the lens that are still spreading strongly, so the lens needs more distance behind it to bring them back together. Moving the subject from 2 m to 0.35 m pushes the image point about 8.7 mm behind the sensor; the lens must move 9.119 mm toward the subject to follow it.
Image distance changes as f²/(u − f)². For far subjects that factor is tiny: from 2 m to 8 m the required spacing changes by only 1.000 mm, and from 8 m to infinity by 0.316 mm. The microscope keeps those small, real movements visible without exaggerating them.
This rail moves one ideal lens. Many real lenses move an internal group instead, and a macro focusing rail moves the whole camera. Those are different mechanisms; quantitative claims for them would need their own validated prescriptions.
The thin-lens equation is 1/f = 1/u + 1/v, with u from subject to lens and v from lens to image. The sensor and subject are fixed U apart, so moving the lens changes u = U − s as well as the spacing s.
Correct focus needs 1/f = 1/(U − s) + 1/s. The ordinary-camera solution is s = 2f / (1 + √(1 − 4f/U)), the numerically stable form of (U − √(U² − 4fU))/2. At infinity s = f; at U = 4f = 200 mm the two solutions meet at s = 2f and 1:1 magnification; below that no lens position focuses. The blur diameter is c = D·|1 − s/v| with D = f/N = 25 mm. This section measures subject distance from the sensor; the aperture experiment above measures it from the lens.
Sources: OpenStax, thin-lens geometry; MIT 2.71, pupils and stops; MIT 2.71, defocus and wave propagation; Edmund Optics, the Airy disk; Nikon, aperture and bokeh. Further reading and visual inspiration: Bartosz Ciechanowski, Cameras and Lenses. These interactive drawings were made for this site.
Focal length changes the frame; camera distance changes perspective. Separate those two effects using a ball with a grid drawn on its curved surface.
Up close, the front of the ball is much nearer than its edges. Nearby surface features project larger, and the tangent horizon hides more of the sphere. As the camera backs away, those distance differences become a smaller fraction of the total, so the grid looks flatter.
With the camera fixed, a longer focal length scales the entire projected image. It shows a narrower field of view without changing the relative sizes of features. The perspective change in “Match framing” comes from moving the camera, not from focal length alone.
The ball is 36 cm across. This ideal rectilinear camera projects each surface point using x′ = f x / z and hides points beyond the sphere’s tangent horizon. A ray through the lens centre continues to the opposite side of the sensor; the camera view above is displayed upright.
Matching the ball’s image radius s gives d = R √(1 + (f / s)²), where d is centre distance and R is ball radius. The target image radius is 9 mm. This isolates framing and perspective; it does not model lens barrel or pincushion distortion, focusing mechanics, depth of field or diffraction.
Sensor exposure follows shutter time divided by the square of the f-number. Doubling ISO doubles the reference output gain. These relationships let several combinations produce the same brightness while changing depth of field, motion blur and the amount of light actually collected.
The bench uses exact full-stop aperture ratios; familiar f-number labels are rounded. The light meter shows camera EV = log₂(N²/t), where N is the f-number and t is seconds. ISO changes output gain separately; it does not change this camera EV. The reference scene is f/4, 1/125 s at ISO 100.
The generated three-box illustration uses a 50 mm teaching lens and an approximate depth map. Its blur, brightness and grain illustrate the direction of change; the image and assigned distances are not a calibrated camera capture. The ray diagram below the scene uses the thin-lens equation for its numerical readouts.
Read Nikon’s guide to exposure and ISO sensitivity, or continue to the astronomical photography tool.