Lens Correction


Camera lenses are not perfect, they have several optical problems. Apart from issues like for example bad focusing, there are two most important faults: chromatic aberration and distortion, that fortunately can be repaired by software means. Having a possibility to correct that allows us to use cheaper lenses and still achieve very good quality of photos. Of course it can't convince professional photographers, because the software correction is not magic that can recover lost details. For professional purposes you still need a top-shelf equipment, but the level of required software lens correction, to further improve the quality, is much smaller.

Software lens correction is also used by camera manufacturers to reduce costs, weight and sizes of the lenses. Instead of adding more elements with low dispersion ED glass to the compact camera lenses, they just choose to let the camera's processor do the job. The processor applies correction with predefined parameters as programmed by the manufacturer. Also, some DSLR cameras do correct at least chromatic aberration, knowing the model of the attached lens, however due to marketing reasons it probably works only if you use lenses of the camera's manufacturer.

Lens correction is not a fully automatic process, it requires usage of previosly measured parameters. EasyHDR gets those parameters from the Lensfun database of cameras and lenses allowing automatic operation, if the camera and lens are found in the database. However, as lens correction makes sense only once, you need to know whether it was already applied or not. There are two cases:


When you use easyHDR's Lightroom plug-in with option to let Lightroom do RAW development, you shouldn't do lens correction in easyHDR, because Lightroom does it before exporting.


Below is a preview of a RAW photo taken with Canon PowerShot G7 X, whithout any lens correction applied. You can see very strong distortion, which even produced strong vignetting. This is a perfect example of a camera with lens correction built into the processor. A JPEG directly from the camera is already flattened, but if you want to process RAWs, you need to correct distortion on your own, using software like easyHDR.

Developed RAW, before lens correction applied

EasyHDR, using Lensfun database, applied correction with predefined parameters. Below is how the photo looks after correction. EasyHDR automatically crops the photo, cutting away portions that fall outside the original image rectangle.

Developed RAW, after lens correction applied with easyHDR

With easyHDR's lens correction tool you got full insight into the process and you can apply manual changes of the parameters in case if they don't do the job in the best way. EasyHDR automatically detects the camera and the lens by reading EXIF metadata and searches for the correction parameters in the database. If the equipment is not found, you can still use the lens correction tool manually. In the simplified, manual mode, the simplest numerical models are used leaving just two parameters to change to compensate chromatic aberration and just a single parameter to repair the distortion.

Manual lens correction


One more lens fault, vignetting, can be repaired (or added if you want to have this effect) at the tone mapping step. Please look at the bottom of the tone mapping parameters panel. It is also possible to apply distortion, rotation and perspective transformation any time during tone mapping - option available in the Image menu.

You can find more information on lens correction with easyHDR in the User Manual.

Adding custom cameras and lenses, updating the database

The Lensfun database is a set of XML files. Each file is for different manufacturer's cameras, mounts and lenses. The compact and SLR cameras are additionally separated. The database is installed in easyHDR's program subfolder: \lensfun\data\db. EasyHDR uses the correction parameters for photos which can be associated with particular models from the database. The cameras and lenses names stored in the photo's EXIF must match (or be very similar) to the names in the database.

The XML files can be modified, or new files can be added by the user. That is not recommended because the user changes can be lost when new easyHDR version is installed. Also, it's not a good practice to modify files in the program files area. Therefore, there is a special place, in the user's space, for the own created Lensfun files. On Windows it's: C:\Users\<user name>\easyHDR 3\lensfun-user, while on Mac OS X: /Users/<user name>/Documents/easyHDR3/lensfun-user.

The easiest way to add own models is to copy the most similar from the original Lensfun files, apply modifications (manually found with Lens Correction tool in easyHDR), put it into a new XML file and store the file into the user's location. You can also find the parameters by calibrating the camera and the lens with specialized programs. Here is a sample file manually created for Canon PowerShot SX50 HS. Please note that easyHDR needs to be restarted after modifying the database files.

The Lensfun database is updated and maintained by community. Please check out the full list of the lenses and cameras covered by the latest release version of the database. The version number used by easyHDR can be checked in easyHDR's about dialog. There is also a list of models supported in the Lensfun development version. The development version files are available at sourceforge Git repository.


Back to the main documentation page



Current easyHDR version
3.10   (03.05.2017)