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:
- Gimp, Manual method: Correcting vignette with GIMP | Photo.net Photography Forums; Re: [Gimp-user] Vignetting correction -> "just select an ellipse from upper left to lower right corner, invert the selection, and feather it according to image size. this allows me to either lighten or darken the corner areas, subtly focusing attention on the middle region."; but I'd rather not mess with this manually, as it will be difficult to match the exact center of the brightness "halo",
- Gimp, via lens distortions: Removal of vignetting - Imaging - Image Processing, Help and Techniques - Stargazers Lounge "Filters->Distorts->Lens Distortion; The 'brighten' setting corrects for vignetting. However, you might not be able to de-couple this from the lens distortion settings (I did have some distortion to correct when I used it)" - tried it, its quite difficult to set it up so it corrects just brightness vignetting
- RawTherapee with flat-field correction (How to remove vignetting and color cast from wide angle lens?) - apparently, as per https://rawpedia.rawtherapee.com/Flat-Field, this needs "flat-field image", which in this case would be an image of the background wall only (without the subject) with the same lighting, which I unfortunately don't have; and I've tried it without such a file, but when I click "Auto-Selection" it says "None found", and nothing is changed on the image
- There is a paper Single-Image Vignetting Correction Using Radial Gradient Symmetry, which implies this should be doable in software (they seem to assume that the center of the gradient is always in the center of the image, however) - but even if I do code, it will take me forever to turn this paper into usable code
- There is fulla - Correct lens distortion, vignetting and chromatic aberration command line application, part of Hugin - Panorama photo stitcher; however, it is quite complex to use. I tried
hugin, and I can't really find a part of the UI which deals only with vignetting; and as far as command line is concerned only thing I've found is https://wiki.panotools.org/Tca_correct :
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
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
darktablewith 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
lensfundatabase), not just brightness vignetting potentially from other sources - and can't really be controlled for amount of radial brightness vignetting (additionally,
lensfundoes not seem to have the S3 IS, while it does have S1 IS and S2 IS)