Lens Vignetting Lab (2D)

Side section, stop-plane overlap, a photograph darkened by the computed illumination, and bokeh lights that turn lens-shaped toward the corners.

Switch to 3D

Presets

Playback

Lens

Focal length, f-number and how out of focus the spotlights are.

Barrel

The two baffles (internal openings) that can clip an oblique beam.

Hood or filter stack

A ring in front of the lens: the hood opening is a fourth limiting circle.

Position in the frame

Pick the sensor point, or let the scan sweep from the centre to the corner.

Layers

Model checks

The science

Why the corners are darker than the centre

Two different things dim the corners of a photograph. The first is mechanical (geometric) vignetting: the lens is a tube, and a parallel beam from a point off the axis passes through the tube at a slant. Looking along the beam, every opening in the barrel appears shifted sideways by z tan(theta), where z is its distance along the axis from the stop and theta is the field angle, tan(theta) = y / f for an image height y and focal length f (a rectilinear lens). The light that gets through is the intersection of the stop disc (radius a = f / 2N) with all the shifted discs: front baffle, rear baffle and any hood or filter stack. That intersection is a convex lens or cat's-eye shape, drawn in yellow on the page.

The fraction of the stop that survives is T = A_clear / (pi a^2). For two circles it has an exact form from the law of cosines, A = r1^2 acos((d^2 + r1^2 - r2^2) / (2 d r1)) + r2^2 acos((d^2 + r2^2 - r1^2) / (2 d r2)) - 1/2 sqrt((-d + r1 + r2)(d + r1 - r2)(d - r1 + r2)(d + r1 + r2)); with more circles the page integrates the height of the common region numerically.

The natural cos^4 falloff

Even a lens with no baffles at all gives a darker corner. A sensor point at field angle theta is farther from the exit pupil by 1 / cos(theta) (the inverse-square law gives cos^2), the pupil is seen foreshortened (cos) and the light strikes the sensor obliquely (cos): E(theta) = E(0) cos^4(theta). The page derives it by integrating cos(alpha_sensor) cos(alpha_pupil) / r^2 over a small pupil. Total relative illumination is RI = T cos^4(theta). A 24 mm lens has cos^4 = 0.31 (1.7 stops) at the corner of a full-frame sensor before any baffle clips anything; a 135 mm lens only 0.95.

Stopping down and the cat's-eye bokeh

Making the stop smaller shrinks the disc inside the shifted ones. Once |c_i| + a <= R_i for every baffle i (centre shift c_i, opening radius R_i) the whole disc fits and T = 1. The largest unclipped stop is a = min_i (R_i - |c_i|), so the f-number that clears a given point is N = f / (2 a). Only the cos^4 term then remains, and it cannot be fixed by stopping down. The same overlap shape is the blur spot of an out-of-focus point of light, scaled up by the defocus: round at the centre, a lemon or cat's-eye toward the corners with its long axis tangential, and dimmer too. Stopping down makes the spots round again.

Numerical checks on this page

(1) The exact two-circle lens area is compared with a 400,000-ray Monte Carlo trace through real planes in 3D. (2) The numerical integral of the common region of all circles is compared with the same ray trace. (3) The cos^4 law is checked by integrating the cosine terms over a small exit pupil. The 2D page adds a pixel-by-pixel area test of the drawn shape and a bisection check of the clearing f-number.

Honest simplifications

Rays are drawn and traced straight through the barrel; a real lens bends them with its glass, so the baffle positions here are effective positions as seen in object space, and a real lens is designed with several limiting elements, different pupil positions and deliberately accepted or corrected vignetting. The stop radius is taken as the physical radius f/2N, which equals the entrance pupil only for a thin lens at the stop. Distortion, pupil aberrations, coatings, light loss in glass, sensor micro-lens angle response and software corrections are not modelled. The barrel, baffle and hood dimensions are illustrative, not those of any real product, and the field angle is taken from tan(theta) = y/f (rectilinear projection). Presets are teaching examples, not measurements.

What to try
  • Load Fast 50 mm wide open and watch the scan: at the centre the yellow clear shape is the full green disc, toward the corner the orange and blue circles slide across it and cut it to a cat's-eye. The graph shows the green curve falling below the dashed cos^4 curve.
  • Drag the f-number slider from f/1.2 to f/4: the cat's-eye grows back to a full disc and the corner brightens until only the blue dashed cos^4 curve limits it.
  • Run Experiment: stop down until the corner clears: the readout compares the f-number at which the sweep first finds a fully unclipped beam with the closed-form value (the smallest baffle margin).
  • Load Wide-angle 24 mm: the baffles do not clip at all, yet the corner is 1.7 stops dark. That is the cos^4 law, and no f-number fixes it.
  • Compare Tight hood with Flared petal hood: a long hood with a small opening is a fourth circle far in front of the stop whose shift is large, so it clips the corners first.
  • Switch the sensor to APS-C: the same lens sees only the central part of its image circle, so the same baffles darken the corner much less.
  • In the 2D page look at the lights panel: round spots in the centre, lens-shaped spots at the corners, all oriented along the circles around the frame centre.
Relative illumination across the frame
Relative illumination at this point against f-number
Clear-beam transmission T: your f-number and two and four stops down
Corner relative illumination against focal length (same barrel)
Made with 🟠 Blender