Amateur here. I have some photos, taken on Canon Powershot S3 IS, quite similar to this one (taken from The Irish Times, File photograph: Bryan O’Brien):


There is an obvious vignetting, as in radial darkening towards the edges - which in my case is not because of the lens, but because I have a relatively small light source on top of the camera, and both the subject and the background wall are relatively close to the camera.

Are there any tools/programs that would help me remove this vignetting (that is, made the image more even in brightness) automatically? I'm mostly interested in Linux tools (I work on Ubuntu 18.04), but it would be good to know what other options are there.

My findings so far:

tca_correct is a command-line tool shipped with hugin that can be used to automatically calculate lens chromatic aberration correction parameters. Ideal sample photos would have a lot of contrast over the entire image area, little saturated colour and no blown highlights.

fulla is a command-line tool for correcting lens distortion, vignetting and TCA (chromatic aberration). It is capable of applying the full panotools polynomial to the red and blue channels, thereby correcting any transverse chromatic aberration.

First calculate some TCA correction parameters for a sample image, notice that I'm only going to bother optimising b and v parameters in the lens correction model, you might get better results with the full abcv set of parameters:

tca_correct -o bv DSC_3194.ppm

This outputs some fulla parameters like so:

 -r 0.0000000:0.0001197:0.0000000:0.9997630 -b 0.0000000:-0.0001142:0.0000000:1.0001841

You can now use these with fulla when converting photos from this lens:

 fulla -r 0.0:0.0001197:0.0:0.9997630 -b 0.0:-0.0001142:0.0:1.0001841 -o corrected.tif DSC_3194.ppm

... but again, this seems mostly concerned with lens vignetting, while I'd need something to handle the brightness vignetting present on the image due to other factors (e.g. the lighting itself). Also, I've tried it, but it seems to export only the embedded preview in the .DNG as .tif (which in my case is 128x96 pixels!), and not the entire image, so I cannot really tell if it works or not (edit: tried with feeding tca_correct and fulla a .tif image instead of DNG, and it only does some barely visible scaling/lens distortion, nothing noticeable in terms of the brightness gradient)

  • EDIT2: also darktable with lens correction module (via How can I avoid vignetting when shooting in raw with a Canon Powershot?) - again, it operates on all distortions of a lens type (via lensfun database), not just brightness vignetting potentially from other sources - and can't really be controlled for amount of radial brightness vignetting (additionally, lensfun does not seem to have the S3 IS, while it does have S1 IS and S2 IS)

1 Answer 1


Flat-field correction is designed to solve this problem. If you have access to the same camera and lens, you can capture the reference image yourself. Use a plain white wall that is evenly illuminated and slightly defocused, not a picture of the same background and lighting as the image you want to process.

  • \$\begingroup\$ Excellent, thanks for clearing my confusion, @xiota -> I thought wrongly "flat field" needs a picture of the same background as in the image! \$\endgroup\$
    – sdaau
    Commented Jan 31, 2019 at 21:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.