Last month, I wrote about some risks to shooting photos with your prime lens opened to its widest aperture. In addition to relying too heavily on the buttery look of shallow depth-of-field, I pointed out that many lenses aren't at their sharpest when the aperture is fully open--for example, at a relatively wide f/1.4. A practical technique recommended to beginners is to set their lens to one or two stops below the maximum aperture--so for a f/1.4 lens you would use f/2.8 and for a f/2.8 lens you would use f/5.6. (Remember how recently we talked about f-stops?) In practice from my experience, that "one simple trick" (sorry) is a good principle, but doesn't explain why lenses aren't sharpest at their widest aperture. After all, ultra-wide primes and zooms are expensive, and it doesn't make a lot of sense to spend that premium on an f/1.4 lens if you're going to be shooting at f/2.8 all the time.
I wanted to understand why image sharpness is soft at wide apertures, and why closing apertures beyond a certain point isn't recommended either. So after some more forum diving and research, let's see if we can talk through the explanation of why lenses have sweet spots, and what knowing these "ideal" apertures should mean for your everyday photography.
As always, we want to start by defining our terms. If the goal of finding a lens' sweet spot for aperture is to maximum image sharpness, we have to all be on the same page about what sharpness entails. First off, it should be common sense that when talking about sharpness, we're talking about the point of an image that in focus. This doesn't necessarily mean the very center of the frame; its the parts of your subject that lie in the lens' adjustable focal plane--a space correlated with your depth-of-field. It's difficult to evaluate out-of-focus parts of your composition for sharpness; bokeh has its own evaluative metrics.
More importantly, sharpness should be understood as a combination of two factors: resolution and acutance. The first factor is more easily understood--resolution describes the camera's ability to resolve detail in a scene, often rated in terms of how many distinguishable lines per width of space (eg. lines per mm). Resolution, as you can guess, is itself a factor of the camera sensor--both the number and size of individual sensor pixels. Acutance is a lesser known concept that describes the camera's ability to discern the transitions between edges in an image. Abrupt edge transitions--often seen as high contrast--indicate higher acutance and correlate with higher sharpness, but slow edge transitions is seen as fuzziness or blurriness. This guide does a good job illustrating the two concepts.
So onto the effects of aperture on sharpness.
Remember that when we talked about aperture and f-stops, setting a wider aperture meant you were opening the physical opening between the lens' glass elements and camera sensor to let more light in. More light sounds like a great idea, because you can get good exposures in dark situations without lowering the shutter speed as much. But the physical widening of that aperture hole means that the sensor isn't just getting light from the center of the lens elements, it's getting some light from the outer edges of those elements too. The lens arranges its numerous internal glass elements specifically for each aperture setting, but a general principle for how lenses are made dictates that the wider the aperture, the more light that has to be processed through outer elements.
These elements, of course, are curved. And the lens has to arrange its elements to best direct light passing through different parts of those curves to converge on one point in the sensor. No lens system is perfect and converging that light, and the result is that flaws in the element arrangement create distortions known as optical aberrations. Because of the complexities in light reflection and refraction, these aberrations are numerous in nature. Chromatic aberration (the effect of which is color fringing) is just one common distortion.
In the photo comparisons below (click to enlarge), you can see the effects on sharpness with my Sigma 50mm f/1.4 lens set two stops apart. These are photos taken of a magazine page affixed to a flat surface and illuminated, with my camera on a tripod. The camera was set to manual focus, ISO at 100 with plenty of ambient lighting, and shutter set to auto.
Even when looking at the resized and compressed thumbnail on this page, it's easy to see a dramatic difference between f/1.4 and f/2.8. The differences between f/2.8 and onward are much less noticeable, but still distinguishable if you pixel peep at the full-res JPEG at 100% scale. Yes, f/5.6 looks ever so slightly sharper than f/2.8, but the fact that it's such a small incremental difference is what allows the "lower two stops" rule to work. The same can be seen with text in the comparison below, also cropped from the center of the photo (and center-focused as well).
On the other side of the aperture setting, apparently closing the lens' aperture hole too much can negatively affect sharpness as well. This again has to do with the imperfect way by which light bounces through the lens to eventually converge on an image sensor pixel. When you close the aperture on a lens, the iris blades physically slide closer together to make the hole smaller. Those blades, whether they're straight or curved, have a physical edge that light hits and bounces off of. Some of that light will hit the edge of the iris blades and bounce and interfere with other light (that's why some lenses advertise rounding the blade edge to reduce this effect). And since the opening for light is smaller with a small aperture (high f-number), light passing through that hole has to disperse to reach its intended spot on the sensor. That dispersement, called diffraction, can create optical distortions and reduce the potential resolution of an image. Once again, CambridgeinColour does a good job explaining this optical effect.
To see the detrimental effects of diffraction, though, you have to close your aperture pretty significantly--past what some people call a diffraction limit. My 50mm doesn't even close past f/16, so I did some more tests with my Canon 24-70mm at 70mm, closing the aperture down to f/22.
And you know what? Even at f/22, I'm hard pressed to see considerable sharpness reduction at 100% scaling. It's not an aperture I would use indoors, but can understand why landscape photographers who have all the available light of the sun would care for the difference between f/11 and f/22. In fact, my biggest takeaway from this light testing was that the difference in sharpness in the middle aperture range of my lenses was far less a determining factor for clarity than the stability of the tripod and shutter speed. Minor shakes like the physical press of the shutter button affect sharpness more than shooting at f/4 over f/5.6. And going back to my piece on why shooting shallow has its challenges, it's more important to find the right aperture to get the depth-of-field you're looking for than the right aperture to maximize sharpness. Finding the sweet aperture spot for your camera won't matter if the important details of your subject are lost in bokeh.
But if you are curious about the sweet spot for your lenses, there's unfortunately no good singular database for a consensus (in photography? ha!) on the sharpest apertures for every lens. Searching for "sweet spot" and your lens model will send you down the path of forum thread spelunking. Lensrental's Roger Cicala aggregated some review data for prime lenses, and DPreview's DxOMark charts are useful if they've covered a lens you own. In studying these charts, you can see trade-offs between maximum center sharpness and consistency of sharpness as you close aperture, so there is no single setting that will apply for every type of shot. Use these resources as a starting point for your own practice and testing until you find a setting that works for you.