Optics

The four cosines at the edge of a photograph

Photograph a plain, evenly lit wall with a wide-angle lens and the corners of the picture come out darker than the middle — by more than three photographic stops with a 14 mm lens on a full-frame camera. It is usually blamed on the lens. A perfect lens does it too, and so does a pinhole, because the light reaching the edge of an image is reduced by four separate cosines of the angle it came from: three of them pure geometry, and one the slant at which it lands. Fisheye lenses avoid most of the loss by refusing to keep straight lines straight. Every wide lens is a choice between the two.

Assumes: What a lens is doing, and why three rays are enough · The hole that makes the sharpest picture

What a lens is doing followed rays through a lens and found where the image forms. The essays after it found where it fails to form: the mirror that cannot focus and the off-axis aberrations, the focus that is a slab, not a plane, the flat scene that comes back curved, the colour fringe no aperture can close, and finally the hole that makes the sharpest picture, a pinhole at the size where geometry and diffraction balance. Every one was about where light goes: whether the rays from a point of the scene meet at a point of the image.

This essay asks how much light gets there. A perfect lens, with no aberrations at all, forms every point of the image sharply, and it still does not form an evenly lit image of an evenly lit scene. The edges of the picture are darker, and for a wide-angle lens much darker. The darkening has a law, the cosine to the fourth power of the angle from the axis, and that law contains no property of the glass. It is geometry, and the only ways around it change what the lens does to the shape of the picture.

Four cosines

Take a lens with a small aperture, focused at infinity, and a scene of uniform brightness. Consider the light arriving from straight ahead, which focuses at the centre of the image, and the light from a direction θ\theta off the axis, which focuses at a point a distance ftan⁡θf\tan\theta from the centre. Compare how much light reaches the image per unit area at the two places.

Four cosines between a lens and the edge of its picture. Light from a direction 30° off the axis passing through a lens and landing at the edge of the image, with the four factors that dim it relative to the centre. The aperture, seen from that direction, is foreshortened to cos θ of its area. The image point is further from the lens, f/cos θ instead of f, and the light spreads as the square of the distance: cos²θ. The light arrives at the image plane at a slant, spreading over 1/cos θ more area: one more cos θ. Together, cos⁴θ: at 30° the edge receives 0.563 of the light at the centre, 0.83 photographic stops darker. Nothing here is a fault of the glass. A perfect thin lens, or a pinhole, does it, because it is geometry.
Fig. 1 Light from 30° off the axis (red) reaching the edge of the image, beside light from straight ahead (blue) reaching the centre, with the four factors that dim the edge. At 30° the edge receives 0.563 of the central light, 0.83 of a stop darker.

Four factors separate them. First, the aperture, seen from the direction θ\theta, is foreshortened: a circle seen at a slant is an ellipse of area cos⁡θ\cos\theta times the circle’s, and that much less light from the off-axis direction passes it. Second and third, the image point is further from the lens, at a distance f/cos⁡θf/\cos\theta rather than ff, and light from the aperture spreads as the inverse square of that distance: a factor of cos⁡2θ\cos^2\theta. Fourth, the light arrives at the image plane at a slant, so a beam of a given cross-section spreads over 1/cos⁡θ1/\cos\theta more area of the plane. Multiplying them,

E(θ)=E0cos⁡4θ.E(\theta) = E_0\cos^4\theta.

At thirty degrees the edge of the image receives 0.56 of the light at the centre; at forty-five, a quarter; at sixty, a sixteenth. None of the four factors involves the glass. They come from where the aperture is and where the image plane is, and a pinhole, which has no glass at all, obeys the same law exactly.

What the law costs a photograph

Photographers measure light in stops, each a factor of two. A cosine-fourth loss of a quarter is two stops, of a sixteenth four.

How many stops a wide lens loses at the corners. The darkening of a uniform scene across a 36 × 24 mm frame, in photographic stops below the centre, against distance from the centre up to the corner (21.6 mm), for ideal rectilinear lenses of 50, 24 and 14 mm focal length, from cos⁴θ alone. At the corner the 50 mm lens, seeing 23.4° off axis, loses 0.49 stop; the 24 mm, at 42.0°, 1.72 stops; the 14 mm, at 57.1°, 3.52 stops — its corners receive 9 per cent of the light at the centre. The loss depends only on the angle, so a phone camera with the same field of view loses the same stops on a sensor several times smaller. Mechanical vignetting by the lens barrel, at wide apertures, adds to it.
Fig. 2 The darkening across a 36 × 24 mm frame from cos⁴θ alone, in stops, for ideal lenses of 50, 24 and 14 mm. At the corner, 21.6 mm from the centre, the 50 mm lens loses 0.49 stop, the 24 mm 1.72 and the 14 mm 3.52.

On a full-frame camera, whose corner is 21.6 millimetres from the centre, a standard 50-millimetre lens sees the corner from 23.4 degrees off the axis and loses half a stop there, which is barely noticeable in most photographs. A 24-millimetre wide-angle lens, seeing the corner from 42 degrees, loses 1.7 stops, which is clearly visible on a plain sky. A 14-millimetre ultra-wide, at 57 degrees, loses 3.5 stops: its corners receive nine per cent of the light at its centre. On top of that, a real lens used at a wide aperture loses more at the edges because its barrel and its internal stops clip the oblique bundles, which is called mechanical vignetting and which stopping down removes. The cosine-fourth loss does not change with the aperture at all.

The loss depends only on the angle. A phone’s camera, whose lens covers the same field of view as a 26-millimetre lens on full frame, loses the same one and a half stops in its corners on a sensor several times smaller. Scale does not enter the four cosines; only the angle does.

A plain wall photographed with a 20 mm lens. Contours of the illumination across a 36 × 24 mm frame when an ideal rectilinear 20 mm lens photographs a uniformly lit wall, from cos⁴θ alone: the lines mark 90, 80, 70, 60, 50 and 40 per cent of the light at the centre. The contours are circles about the centre, cut off by the frame's edges; the middles of the long sides fall to 54 per cent, the middles of the short sides to 31 per cent, and the corners to 21 per cent, 2.2 stops down. In a photograph the darkening is usually read as a property of the lens — vignetting, corrected in software — but even a perfect lens of this field would produce it, and the correction multiplies the corners' noise along with their light.
Fig. 3 Contours of illumination across a 36 × 24 mm frame for an ideal 20 mm lens photographing a uniform wall: 90 down to 40 per cent of the centre. The middles of the long sides fall to 54 per cent, the middles of the short sides to 31, the corners to 21.

Drawn across the frame of a 20-millimetre lens, the illumination falls in circles centred on the middle of the picture, cut off by the frame’s edges: the middles of the long sides at 54 per cent, of the short sides at 31, and the corners at 21, more than two stops down. Every modern camera corrects this in its software by brightening the edges of every picture, which is why the effect is rarely seen in photographs. But brightening the corners by two stops also multiplies their noise by the same factor: a corner that received a fifth of the light has the noise of a picture taken with a fifth of the light, however it is processed afterwards. The four cosines are paid for in photons, not in appearance.

A pinhole has no way out

The law is clearest in the simplest camera. The hole that makes the sharpest picture found the size of pinhole that balances geometry against diffraction; whatever its size, a pinhole obeys the four cosines exactly, because each of them is a statement about a small aperture and a flat screen, and a pinhole is nothing else. A pinhole camera with a wide field is therefore always dark at the edges, and photographers who build them for wide views often curve the film into a cylinder or a bowl round the hole, which removes the slanted arrival and the lengthened path at once and leaves only the foreshortened aperture. The curved screen does for the pinhole what the curved retina does for the eye.

The cube that lighting engineers use

The same cosines, counted from the other end, are the rules by which rooms and streets are lit. A small lamp hanging at a height hh above a floor lights the point directly beneath it with an illuminance I/h2I/h^2, from the inverse square law of the shape that decides the falloff. A point on the floor a horizontal distance away sees the lamp at an angle θ\theta from the vertical: it is further away, by 1/cos⁡θ1/\cos\theta, which gives cos⁡2θ\cos^2\theta, and the light arrives at a slant, which gives one more. The floor’s illuminance falls as cos⁡3θ\cos^3\theta, the lighting engineer’s cosine-cubed law. It is one cosine short of the camera’s law because a lamp is a point and has no aperture to foreshorten.

At forty-five degrees, a point on the floor as far from the lamp’s foot as the lamp is high, the cube is 0.35: barely a third of the light under the lamp. That is why street lamps are spaced at three or four times their height and given reflectors that throw more light sideways than down, and why a single ceiling light leaves the corners of a room dim. The reflector’s job is to cancel the cube, in the same way that Rusinov’s growing pupil cancels one of the camera’s four cosines.

Narrow fields barely notice

The law is steep only at large angles. At five degrees off the axis cos⁡4θ\cos^4\theta is 0.985; at one degree, 0.9994. A telephoto lens, whose whole field is a few degrees across, has no visible cosine-fourth darkening at all, and an astronomical telescope with a field of a degree or two loses a fraction of a per cent at its edge. Astronomers nevertheless photograph a uniformly lit screen or the twilight sky before every night’s observing and divide every image by it — the flat field — because the far larger irregularities from dust on the filters and from pixel-to-pixel differences in the sensor have to be removed anyway, and the geometric falloff is removed with them for free. Even the widest survey telescopes, whose fields reach three or four degrees, lose less than a per cent to the four cosines; their difficulties at the edge of the field are aberrations — the coma that the condition a lens must meet traced to the sine condition — not illumination.

The angle mapped onto the picture

The most interesting thing about the law is that it is not universal. It assumes that the lens maps a direction θ\theta off the axis to a point ftan⁡θf\tan\theta from the centre of the image. That mapping is what makes a lens rectilinear: straight lines in the scene come out straight in the picture. It is not the only mapping a lens can have.

Where each kind of lens puts a direction on the picture. Distance from the centre of the image, in units of the focal length, against the angle off the axis for the four mappings. The ordinary lens, f tan θ, runs away to infinity at 90° — it cannot image a hemisphere at all — and spreads the edge of the field over ever more area, which is where its cos⁴ darkening comes from. At 60° it places the direction 1.73 focal lengths out, the stereographic fisheye 1.15, the equidistant 1.05, the equal-area 1.00. The fisheyes compress the edge of the field, bending straight lines into curves, and keep a whole hemisphere on a finite disc with the edge still lit. Every mapping is a choice between straight lines and even light; no lens can have both across a wide field.
Fig. 4 Image height, in focal lengths, against the angle off the axis for four mappings: the ordinary lens, f tan θ, which runs away to infinity at 90°; the stereographic fisheye, 2f tan(θ/2); the equidistant, fθ; and the equal-area, 2f sin(θ/2). At 60° they place the direction at 1.73, 1.15, 1.05 and 1.00 focal lengths.

A rectilinear lens cannot image a hemisphere at all: as θ\theta approaches ninety degrees, tan⁡θ\tan\theta runs to infinity, and the image would have to be infinitely large. Long before that, the edge of the field is spread over enormous areas of image: the band of directions between fifty and sixty degrees off the axis covers more of the image than everything within thirty degrees. Fisheye lenses map angles differently, compressing the edge of the field. The equidistant fisheye puts a direction θ\theta at a distance fθf\theta from the centre, proportional to the angle; the equal-area fisheye at 2fsin⁡(θ/2)2f\sin(\theta/2), which keeps equal solid angles of the scene on equal areas of the image; the stereographic at 2ftan⁡(θ/2)2f\tan(\theta/2), which keeps small shapes undistorted. All three fit a whole hemisphere on a disc a couple of focal lengths across, and all three bend straight lines into curves, more and more towards the edge.

How the mapping sets the darkening

The illumination of the image follows from the mapping by a single principle: the light passing through the aperture from a small patch of sky is spread over whatever area of image the mapping gives that patch. The light through the aperture is the same for every design — it is set by the aperture’s area, foreshortened by cos⁡θ\cos\theta — so a mapping that gives the edge of the field a small area of image keeps that area bright, and a mapping that gives it a large area spreads it thin. The general rule is E∝cos⁡θsin⁡θ/(r r′)E \propto \cos\theta\sin\theta/(r\,r'), with r(θ)r(\theta) the mapping and r′r' its derivative. For the rectilinear mapping that is cos⁡4θ\cos^4\theta. For the others it is gentler.

How the edge darkens depends on how the lens maps angles. The illumination of the image of a uniform scene, relative to the centre, against the angle off the axis, for four ways a lens can map angles onto the image: an ordinary rectilinear lens, which keeps straight lines straight (cos⁴θ); the stereographic fisheye, cos θ cos⁴(θ/2); the equidistant fisheye, cos θ sin θ/θ; and the equal-area fisheye, cos θ. At 60° the ordinary lens delivers 0.063 of the central light, the stereographic 0.281, the equidistant 0.413, the equal-area 0.500. The light passing the aperture from each direction is the same in every design; what differs is how much image area each design gives to that direction. A lens that crowds the edge of the field into a small area keeps the edge bright, at the cost of bending straight lines.
Fig. 5 Relative illumination against angle for the four mappings. At 60° the ordinary lens delivers 0.063 of the central light, the stereographic 0.281, the equidistant 0.413 and the equal-area 0.500 — which falls only as cos θ, the aperture’s foreshortening alone.

At sixty degrees off the axis the ordinary lens delivers six per cent of the central light; the stereographic fisheye twenty-eight; the equidistant forty-one; the equal-area fifty. The equal-area fisheye loses only the single cosine of the aperture’s foreshortening, because by construction it gives every patch of sky an area of image proportional to its solid angle, so nothing is spread thinner at the edge than at the centre. It is the mapping used for all-sky cameras that measure the brightness of the sky, precisely because a uniform sky comes out nearly uniform.

That is the trade every wide lens makes. Straight lines and even light cannot both be had across a wide field, because the rectilinear mapping that keeps lines straight is exactly the one that stretches the edge of the field the most. An architectural photographer, who needs vertical walls to stay vertical, chooses the rectilinear lens and lives with dark corners; a scientist photographing the whole sky chooses the fisheye and lives with curved horizons.

Cheating the aperture

There is one factor in the four that a designer can attack without giving up straight lines: the first, the aperture’s foreshortening. In a real wide-angle lens the aperture stop sits inside the lens, behind several elements, and what the scene sees is the image of that stop formed by the elements in front of it — the entrance pupil. Nothing requires the entrance pupil to look the same from every direction. A lens whose front elements are strongly curved can make the entrance pupil appear larger and tilted towards the viewer for oblique directions, so that from the edge of the field the aperture looks bigger, not smaller.

The Russian designer Rusinov exploited this in the 1940s in a wide-angle lens for aerial survey, whose pupil grows off axis enough to cancel one of the cosines, and later designs with large, strongly curved front elements — the bulbous front of a modern ultra-wide — recover more. Such lenses lose noticeably less than cos⁡4\cos^4 while staying rectilinear. The cost is in size, weight and the difficulty of correcting the other aberrations with such curved elements. The geometry of the remaining three cosines cannot be argued with.

The fourth cosine, the slant of arrival, returns in a different guise at the sensor. Each pixel of a digital sensor has a tiny lens on top of it to funnel light into its light-sensitive well, and light arriving steeply at the edge of the sensor misses the well and is lost, adding to the darkening. Lenses designed for digital cameras try to send the light from every part of the field towards the sensor nearly perpendicularly — a design called image-side telecentric — and sensors shift their microlenses progressively towards the corners to point them at the lens. Some short wide-angle lenses designed for film, which did not care about the angle of arrival, show dark, coloured corners on digital cameras for exactly this reason.

The eye’s version

The eye has the same geometry and avoids most of the penalty in its own way. Its retina is not a flat plane but the inside of a sphere, so the light from an oblique direction arrives at the retina roughly perpendicularly and the image point is roughly as far from the pupil as the central one: two of the four cosines are largely removed. And the eye’s pupil, seen from the side, is magnified by the curved cornea in front of it, so that the entrance pupil appears less foreshortened at large angles than a flat aperture would, much as Rusinov’s lens does. Measured from the outside, a human eye’s apparent pupil seen from sixty degrees off its axis is still more than half its frontal area. The visual field reaches beyond ninety degrees to the side, and the far periphery is dim but not dark. The eye even has its own version of the sensor’s microlenses. Its cone cells are not equally sensitive to light from every direction: each is a tiny waveguide that accepts light best along its own axis, and the cones across the retina are tilted to point at the centre of the pupil. Light entering near the edge of the pupil therefore stimulates them less than light through the middle — the Stiles–Crawford effect, found in 1933 — which is the eye’s own arrival-angle loss, built in and partly useful, since it suppresses the poorly focused light from the pupil’s rim.

What the pictures cannot show

The figures assume a small aperture, a scene of uniform brightness emitting equally in all directions, a lens with no losses that vary across the field, and a flat image plane. A real wide-angle lens at a wide aperture adds mechanical vignetting, which clips oblique bundles and depends on the aperture; its coatings transmit slightly less at steep angles; and its pupil changes size and shape across the field by an amount particular to the design, which the figures set aside. The fisheye mappings are drawn as ideal; real fisheyes approximate them and depart at the edge. The sensor’s own loss at steep angles is not included.

Still open: wide fields on curved sensors

The cleanest way to remove the slanted-arrival cosine and much of the path-length one is the eye’s: a curved image surface. Curved image sensors, bent into a bowl before they are mounted, have been demonstrated in laboratories and in a few small cameras; they let a much simpler lens cover a wide field with even illumination and with the curvature of field of the flat scene that comes back curved cancelled instead of fought. Whether they can be made reliably at the sizes and costs of ordinary camera sensors, and whether the lenses designed around them will displace the complicated flat-field designs that dominate now, is being worked out by sensor makers.

The habit worth carrying away is to ask which of a result’s factors come from the instrument and which from geometry. An image of a uniform scene through an ideal lens falls off as cos⁴θ — the aperture foreshortened, the path lengthened squared, the arrival slanted — so a perfect 14 mm lens on full frame loses 3.5 stops at the corner; only a mapping that bends straight lines, or a pupil that grows off axis, can do better. The dark corners are the price of straight lines.

Part 9 of 9

This essay is one argument about Imaging. The others:

The objects named here

The third axis, after the field and the reading path: the things themselves, and every essay that touches each one.

DistortionField of viewFisheye lensIlluminanceThe inverse-square lawLens mappingRadianceVignetting