# Anti Vignetting

Gilles
Caulier

    caulier dot gilles at free.fr

Gerhard
Kulzer

    gerhard at kulzer.net

2005-02-26
0.7.2

The digiKam image plugin Anti Vignetting is a tool to correct image vignetting (under exposure in the corners).

KDE
Digikam

# Introduction

Wide angle lenses, especially those used in medium and large format photography, frequently do not uniformly illuminate the entire film plane. Instead, they "vignette" the edges and corners of the image, substantially reducing the light reaching the film there. But telelenses may show vignetting too.

The traditional solution for this is to attach a "centre filter" to the lens. This is a neutral density filter with maximum density at the optical axis of the lens, clear at the periphery, with density varying inversely to the vignetting of the lens. A centre filter has many advantages: not only does it automatically correct for full-frame images but, since it's fixed to the front of the lens, it also compensates for the off-centre vignetting which occurs when camera movements are employed for perspective or plane of focus adjustment.

But there are disadvantages as well. Many centre filters require a 1.5 or 2 f-stop filter factor adjustment, which may, in turn, necessitate a shutter speed so slow (since wide angle lenses, even with centre filters, are best used at apertures of f/16 or smaller) that hand-holding the camera is impossible and motion blur becomes a problem when photographing moving objects.

With the wide latitude of present-day film and the colour (or grey-scale) depth of digital camera or film scanners, it's possible to simulate the effect of a centre filter after the fact by applying an equivalent transform to a raw image taken without the filter. This plugin applies to an image a centre filter transformation. It employs an algorithm copyrighted by John Walker.

## Using the plugin

Three sliders give you control over the vignetting correction filter, and three others over the target image exposure:

Density: this option controls the degree of intensity attenuation by the filter at its point of maximum density. The default density is 20, which corresponds to an optical filter with a 1 f-stop filter factor. Increase the density to compensate for a greater degree of vignetting; reduce it for less.

Power: this option determines the rate at which the filter intensity falls off from the point of maximum density toward the edges, expressed as a power factor. The default of 1 yields a linear reduction in filter density with distance from the centre. Power factors greater than 10 cause a faster fall-off (for example, a power of 20 causes the density to decrease as the square of the distance from the centre) and causes the effect of the filter to be concentrated near the centre. Powers less than 10 spread out the density of the filter toward the edges; a power of 5 causes the density to fall as the square root of the distance from the centre.

Radius: this option specifies the radius, as a multiple of the half diagonal measure of the image, at which the density of the filter falls to zero (or, in other words, becomes transparent). The default value of 10 specifies a filter which, if centred upon the image, is transparent at its corners. A radius specification greater than 10 extends the effect of the centre filter beyond the edges of the image, while a radius less than one limits the filter's action to a region smaller than the image. When compensating for vignetting by lenses used with large format and some medium format cameras, the default radius factor of 10 is rarely correct! These lenses often "cover" an image circle substantially larger than the film to permit camera movements to control perspective and focus, and consequently have a vignetting pattern which extends well beyond the edges of the film, requiring a radius setting greater than 10 to simulate a centre filter covering the entire image circle.

The only way to be sure which settings of Density, Power, and Radius best compensate for the actual optical characteristics of a given lens is to expose a uniformly illuminated scene (for example, a grey card lit by diffuse light) and perform densitometry on the resulting image. Failing that, or specifications by the lens manufacturer giving the precise degree of vignetting at one or more working apertures, you may have to experiment with different settings to find those which work best for each of your lenses. For help you in this task, the plugin dialog provide a thumbnail mask rendering applied on the image. Fortunately, the response of the human eye is logarithmic, not linear like most digital imaging sensors, so you needn't precisely compensate for the actual vignetting to create images which viewers will perceive as uniformly illuminated.

Brightness, Contrast, and Gamma settings: processing an image with this plugin reduces the intensity of pixels. You need to re-adjust the target image exposure with these options. These sliders give only positive values because you need only to increase this setting.

If you want a finer exposure re-adjustment of the target image, leave the Brightness/Contrast/Gamma values at zero and use the Adjust Curve tool from digiKam Image Editor available on Fix ColorsAdjust Curve menu entry.

## The plugin in action

This is an example of an anti vignetting correction apply to an image. The original image (1) shows a coastline eroding into a beach below with a magnificent cloudscape above, the corrected image (2). A brightness and contrast correction is also applied to the target image by this plugin.

The values used for this example are:

- Density = 50.

- Power = 10.

- Radius = 10.

- Luminosity = 30.

- Contrast = 40.

- Gamma = 0.

Anti Vignetting image effect preview