Diffraction is an optical phenomenon with the potential to have a limiting effect on image resolution. Light normally travels in straight lines through uniform media but when it is restricted by passing through a small opening, such as that presented by the diaphragm in a lens, it tends to diverge or diffract into areas of "shadow". The effect is negligible in most normal circumstances because the wavelength of light is small when compared to everyday objects, but when very small apertures are used to maximize depth of field or facilitate the use of a long exposure it may become significant.
The divergent rays emerging from a small aperture follow different paths and hence travel different distances from the diaphragm to the plane of the film or sensor. They consequently begin to interfere with one another as their relative phases shift. Peaks of intensity are achieved where the amplitudes of interfering rays are added, and troughs occur where phases are opposed and amplitudes cancel each other out. The result is a diffraction pattern similar to that shown in the diagram. Intensities vary in waves as distance from the centre of the lens increases and changes of phase in the diffracted rays add and subtract. The effect typically produces concentric rings of varying intensity. The two-dimensional representation of this pattern is known as the Airy disk, and is named after George Airy who was the seventh Astronomer Royal.
Diffraction effectively imposes an absolute limit on the resolution of an image. The effect is independent of the grain size of a film or the number of megapixels on a sensor, and is unaffected by the format of the camera system. It is dependent only upon the f/stop selected, and hence the diameter of the aperture, and the wavelength of the light transmitted by the lens.
In practice, lenses usually produce somewhat softer images at maximum aperture. Diffraction effects are negligible at large or medium apertures but may become significant at smaller settings such as f/22, f/32 or f/64 when images are captured using a tripod, and high-quality lenses. In images acquired under less than ideal circumstances, other effects such as camera movement may cause greater loss of sharpness. Photographers striving for maximum depth of field and sharpness throughout an image must therefore use mid-range or small apertures but should nevertheless not automatically select the smallest possible aperture. A fall-off in sharpness may occur due to diffraction effects and therefore counter any gain in sharpness arising from increased depth of field. Optimum sharpness is typically achieved when using apertures which lie close to the diffraction limit for a particular lens.