In geometric optics, distortion is a type of optical aberration that happens when there is a variation in magnification across the visual field.
Barrel distortion results when a lens magnifies slightly more at its thickest part (along the optical axis, so image magnification decreases with distance from the optical axis) than it does at its edges; the image of a square shape would thus appear to have bulged-out sides.
Fisheye lenses, which take hemispherical views, utilize this type of distortion as a way to map an infinitely wide object plane into a finite image area. In a zoom lens, barrel distortion appears in the middle of the lens’s focal length range and is worst at the wide-angle end of the range.
Pincushion distortion comes about when magnification increases away from the optical axis causing image lines, both vertical and horizontal, to bend in toward the center of the image. Neither kind of distortion affects resolution; it simply means that the image shape doesn’t correspond exactly to the shape of the object.
A mixture of both types, sometimes referred to as mustache distortion (mustache distortion) or complex distortion, is less common but not rare. It starts as barrel distortion close to the image center and gradually turns into pincushion distortion towards the image periphery, making horizontal lines in the top half of the frame look like a handlebar mustache.