Lens distortion correction on post-processing

Lens distortion is a technical aspect often overlooked by photographers. Strong lens distortion can ruin a good picture, especially when photographing people or architecture.
Published by Fábio Pili on September 18th, 2010. Last updated on June 12th, 2013.

This form of optical aberration is caused by how the lens projects the light rays over the flat sensor or film surface. A perfectly rectilinear lens would project the light rays absolutely aligned on the sensor plane, no matter where on the frame, while a real world lens, always bearing some degree of distortion, bends those rays unequally throughout the frame. This distortion doesn’t depend on the focal length of the lens, although it’s more often seen on wide angles or megazoom lenses.

Distortion Correction

Golden Trumpet Tree - Tabebuia alba. Brasília - Brazil. © Fábio Pili

Nikon D300 + Tokina 12-24mm f/4 @ 12mm.
Corrected with PTLens. Mouseover for the original uncorrected image.

Types of lens distortion

Barrel distortion

Barrel distortionImage magnification decreases with the distance from the frame central point, causing a subtle fish-eye effect, as if the image were projected on a spherical surface. Straight lines near the frame edges bend away the frame center.

Pincushion distortion

Pincushion distortionIt’s the opposite of barrel distortion. Image magnification increases with the distance from the frame central point, as if the image were projected on a concave surface. Straight lines near the frame edges bulge toward the frame center.

Mustache distortion, also called complex distortion

Mustache distortionIt’s a mix of barrel and pincushion distortion, gradually varying from the frame center to the edges. This is the most difficult type of distortion to correct, as it may change with the focal length on zoom lenses, and requires a more complex mapping to be neutralized. Photoshop’s Lens Distortion and Spherize tools won’t help you here.

Don’t confuse perspective with distortion

Lens distortion and perspective distortion are two different things. Perspective distortion is caused by distance from the camera to the subject, regardless of the lens used. If you take the same picture on a telephoto and a wide angle lens, but crop the wide angle image to have the exact same coverage, the two lenses will show the same amount of perspective distortion. Since different focal lengths have different coverages, you have to get closer to your subject to fill the frame with a wide angle lens, thus leading to more perspective distortion.

Wikipedia has a nice article explaining it better than I could.

Why correct lens distortion

Curved buildings and distorted faces are easily detected by our brain, looking unnatural. If you shoot a portrait, correcting the lens distortion can give you a more pleasant rendition of the model’s face. For architecture photographers it’s even more important, since it’s impossible to have a perfectly adjusted perspective if the image has lots of lens aberrations and distortions.

In-camera lens distortion correction

With the advent of digital photography, it became easy for manufacturers to compensate for lens aberrations with software. Some cameras might even apply that correction in-camera, before any file is written. Even the LCD preview is corrected this way.

By compensating for the optical imperfections in software, manufacturers can design lenses that are far from ideal optically, but cost less and are smaller and lighter. This is especially important in the compact camera market, where price and size are two of the most important factors.

For example, Canon takes this route on their highly regarded Powershot S90 and S95 compact cameras. Panasonic uses it on the LX3 and LX5 models. Olympus Micro Four Thirds cameras, like the E-P2 and E-PL1, correct for geometric distortion in software, while Panasonic’s Micro Four Thirds models go a step further and also provide chromatic aberration (aka. purple fringing) correction.

Recent Nikon DSLRs also compensate for chromatic aberration through software—in-camera, for JPG files, or by embedded information on RAW files. I’m a Nikon user and this is one of the reasons I use Nikon Capture NX2 to process most of my RAW files. The chromatic aberration correction is perfect, effortless, and I could never match it on other raw converters.

Fixing lens distortion on post-processing


Amazon Theatre, Manaus, Brazil. © Fábio Pili.

Nikon D300 + Nikon 17-55mm @ 24mm. Distortion and perspective correction using PTLens.

My tool of choice for fixing lens distortion is PTLens. This inexpensive program (US$25) works on Windows and MacOS computers; integrates with Photoshop, Aperture, and Lightroom; and has an extensive database of lenses. It can also be used for perspective correction, which comes in handy for architecture photography. PTLens also has tools for vignetting and chromatic aberrations, but I prefer to handle those on my RAW developer. PTLens comes in on the last phases of my workflow, after I export the processed RAW file to a master 16bit TIFF.

Nikon Capture NX2 has an auto distortion correction, but that works only on Nikon G or D type lenses. I use it sometimes, but I have some third-party lenses from Sigma and Tokina, so it’s not a complete solution for me.

Adobe Lightroom 3 and Photoshop CS5 now have a lens correction module that handles distortion and chromatic aberration. It has worked very well in my tests, and Adobe has added several lenses to their latest Lightroom and Camera Raw updates.

Take note, however, that more complex distortion patterns on zoom lenses, such as the Canon 24-105mm f/4L mustache distortion, are not handled so well by Lightroom and Photoshop CS5. Adobe’s documentation for the Lens Profile Creator recommends using six different focal lengths for creating wide angle lenses profiles. PTLens, on the other hand, uses up to 12 focal lengths, producing a more accurate profile. You can see some examples of this difference on this page—Lens correction on the left menu.

Canon Digital Photo Professional—DPP—raw processing software also provides a module for fixing lens distortion, chromatic aberration, and vignetting, but only for some camera and lens combinations. Third-party lenses are not supported.

DXO Optics Pro is a pioneer in this field and was the first program to incorporate lens correction during the raw development phase. The current version—6.2—is a very capable RAW processor and offers fully automated lens correction. You don’t even have to think about it. Just open your RAW file and all corrections are handled automatically, including some corrections that other RAW processors don’t have, like Lens Softness and Volume Anamorphosis—a fancy algorithm to handle spherical volumes, like faces, on the edge of wide angle frames, balancing distortion correction and object geometry.


The main drawback of fixing lens distortion is that you lose a little part of the original frame as it’s stretched or compressed to compensate for distortion. This process also slightly decreases image quality on the affected areas. Usually the difference in image quality is negligible and more than made up for by the better aesthetics of a corrected image.


In-camera distortion correction Can software ever take the place of optical excellence? - Dpreview.com
Lens distortion - DXO Optics
Lens Perspective. Distortion and the face - Stephen Eastwood Photography



Victor Wahby
Dec 9th, 2015 - 12h27

Great article Fabio. Always prefer to correct lens distortion import into Lightroom because it's so distracting. The link above to the article regarding the importance of lens quality versus software correction is broken. Can you tell me if your workflow has changed since you authored this article and also your opinion on the importance of buying an inherently low distortion lens versus relying on software correction please.


Leave a Comment




This form collects your name and e-mail address for the sole purpose of identifying you as an unique commenter on Cameratico. Your data won’t be shared or used in any other way. Check our privacy policy for the full details on how we store and manage any user data.
Submit comment