Lens Correction

Rawtoaces can correct the following lens phenomena when correction is requested:

  • Chromatic Aberration

  • Geometric Distortion

  • Vignetting

Lens correction is disabled by default. Select the correction types using --lens-correction or settings.lens_correction_types to enable it.

To apply lens correction, Rawtoaces requires two key pieces of information:

  • Lens and Shot Information

  • Lens Profile

Lens and shot information (including lens make and model, as well as aperture, focal length, and distance values) is typically extracted automatically from the raw image file’s EXIF metadata. If any required information is missing, rawtoaces utilizes ExifTool to attempt to retrieve the missing data. Alternatively, you can provide the information manually using command-line Lens Correction Options or programmatically through the properties of the rta::util::ImageConverter::Settings object.

Lens profiles are managed by the Lensfun project. If the Lensfun library cannot automatically locate the Lensfun database, you may need to specify the path using the RAWTOACES_LENSFUNDB_PATH environment variable.

Basic usage:

Pass the RAW path as <INPUT_PATH>. Output is <input_stem>_aces.exr beside the input. The API examples set soft crop — full sensor, crop stored as the display window — to match the CLI. C++ and Python default to hard crop.

Request correction of geometric distortion and vignetting:

rawtoaces --crop-mode soft --lens-correction dv <INPUT_PATH>

Without --require-lens-correction (or require_lens_correction = True), a missing profile or other failure warns and conversion continues uncorrected. A successful conversion does not mean the correction was applied.

Request every supported correction, make it mandatory, and override the camera and lens information used for correction. Match the overrides to the image, and use a Lensfun profile calibrated for every requested correction:

rawtoaces                                    \
--crop-mode soft                            \
--lens-correction a                          \
--require-lens-correction                    \
--custom-camera-make "Canon"                 \
--custom-camera-model "EOS R5"               \
--custom-lens-make "Canon"                   \
--custom-lens-model "RF 15-35mm F2.8L IS USM" \
--custom-aperture 4.0                        \
--custom-focal-length 35.0                   \
--custom-focus-distance 240.0                \
<INPUT_PATH>

Note

Overriding the camera make and model affects both lens correction and spectral colour space conversion mode.