JavaScript support is required to run this website properly.
Please enable it in your browser's settings, or turn off the script blocker.

Documentation / Lens correction

Camera lenses are not perfect, they have several optical problems that all have impact on the quality of HDR photos. Apart from issues like for example bad focusing, there are three most important faults: chromatic aberration, lens distortion and vignetting, that fortunately can be repaired by software means. Having a possibility to correct them, allows us to use cheaper lenses and still achieve very good quality of HDR photos. Of course it can't convince professional photographers, because the software correction is not a magic process that can recover lost details. For best quality, professional purposes you still need top-shelf equipment, with which 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.

Correcting the lens distortion, chromatic aberration and vignetting, with easyHDR, is a process that takes place before images are aligned. Fixing distortion actually makes the alignment better. Only after those two steps a HDR image can be created (with or without applying ghost removal).

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 has already been applied or not. There are two cases:

When you use external software to do RAW development, or even JPEG pre-processing, please make sure whether it doesn't also apply the lens correction (which it may do fully or partially - chromatic aberration, vignetting and lens distortion).

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, and 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 applied the correction using the coefficients from the Lensfun database. Below is how the photo looks after the correction. EasyHDR automatically crops the photo, cutting away portions that fall outside the original image rectangle.

Developed RAW, after lens correction applied with easyHDR

Apart from fixing the chromatic aberration by applying LensFun coefficients to slightly resize the color channels in the image, easyHDR brings also an automatic defringing algorithm. It is capable of further reducing the color fringes around distinct edges. It does not require the camera and lens to be defined in the LensFun database. For defringing, you can control its strength and hue selectivity.

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

At the tone mapping stage, you can also further alter the vignetting, distortion and even perspective. For those please use the "Vignetting" in the bottom of the tone mapping parameters and the crop/rotate/distortion/perspective tool available in the "Image" menu.

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"/"Applications" 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 macOS: /Users/<user name>/Documents/easyHDR3/lensfun-user.

The easiest way to add own models is to use the easyHDR's Lens Correction tool itself. You can store the currently visible settings, for the current camera and lens into a separate file and that file will be automatically loaded and used by easyHDR as if it was a part of the LensFun database. In case of zoom lenses, the settings for various focal lengths and apertures are merged into the file. The user-created definitions have higher priority than those within LensFun for the same camera and lens model pair.

Adding own camera and lenses to LensFun

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.

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

Back to the main documentation page

Current easyHDR version
3.16.2   (June 27th 2024)