Lens performance varies according to aperture. When wide open, lenses are subject to depth of field and vignetting; when they are fully closed they suffer from loss of sharpness due to diffraction. The sharpest aperture is not the aperture that records the most evenly sharp image, but the aperture at which the lens is able to resolve the most fine detail—its “resolving power.” A high resolving power records more visible image detail; the finer and more distinguishable the detail, the higher the resolution and the sharper the image.
A lens does not uniformly record a single resolution. Depending on the aperture setting and where in the frame it is recorded, resolution will vary considerably, with sharpness falling off from the center to the corners. Most lenses have the highest resolving power in the center of the frame, two stops above the widest aperture, through to two stops below the smallest aperture. The typical f/stop scale is:
22.845.681116
For a camera with an f/stop scale as above, the sharpest image would come from f/4, f/5.6, and f/8, although the actual sweet spot will differ from lens to lens. Most lens tests record optimal resolving power at f/4 and f/5.6, but as a rough guide you can assume that the optical sharpness in the middle f/stop will be twice as sharp as the f/stops at either end of the scale.
As previously stated, when comparing apertures there are other factors to take into account. Depth of field is deeper at smaller apertures, so at f/16, for example, a scene will be in focus all the way to the corners. On the other hand, diffraction becomes a problem at smaller apertures, so although the image appears to be in focus throughout the frame at f/16, its sharpest point, the center is not as sharp as the center of a photo of the same scene taken with a larger aperture. The photo taken at the larger aperture will not, however, be in focus throughout the frame and will get increasingly soft away from the focal plane as the depth of field gets shallower. Vignetting common at large apertures will add to this effect of softness in the corners.
Larger apertures (but not fully open, where sharpness is reduced) will therefore record images that are sharp in the center but soft in the corners; smaller apertures will be evenly bright and sharp throughout the frame, but not as sharp as possible, due to diffraction. Note that maximum sharpness and maximum depth of field are therefore mutually exclusive.
No matter how sharp the lens, resolution also depends on the film used, with slow, fine-grain films recording more information than fast films. Sharpness will also depend to an extent on shutter speed and camera steadiness, as even the slightest amount of camera shake will affect detail.