Lensfun vignetting correction for Sony kit lenses



I’ve noticed that lensfun vignetting correction for the sony 55-210 kit lens is way off. I noticed it in couple of normal pictures that I took. However, to better showcase it, I took an out-of-focus pictures of a pretty evenly lit wall (I know that it not perfect, but I’m not trying to actully measure vignetting).

SOOC jpg:

Raw file after applying lens correction

i think there is also problems with vignetting correction for the 16-50 kit lens, but it is less pronounced.

(Mica) #2

Its the same for my Fuji kit lens; updates to lensfun are welcome!

I need to find time to do that!


Just got around to check using LCPs from Adobe, and it doesn’t happen with them. The new lensfun library (0.3.95) supports Adobe’s lcps, so this is probably the way to solve it easily.

(Mica) #4

if you want to copy LCPs into lensfun on your own, that’s OK, but I don’t think the lensfun project can legally redistribute things from Adobe.


That is an interesting question, actually. Whilst the profiles themselves (that is to say the XML) are subject to copyright the lens correction coefficients are likely not. This is because they constitute facts about a lens; and facts are not subject to copyright. Thus lensfun can likely make use of the coefficients.

Although, at least for Sony RAW files, the goal should be to properly understand the format of the vignetting coefficients which are baked into the RAW file by the camera. (Documentation however is scant, and it appears as not even Sony’s own Image Data Converter utility makes use of them.)

(Mica) #6

Indeed you are correct, I was referring to the LCP file itself, which are supported in RawTherapee, but are not distributed because they’re not redistribuitable files. RawSpeed, the decoding library for darktable, makes use of some of these facts gleaned from the Adobe converter.


I noticed that also the Sony E 50mm f/1.8 gets too aggressive vignetting correction in lensfun (in Adobe’s LCP the corrections seems correct). it makes me wonder whether there might be more lenses affected.

The problem with the lcps is that they are not supported by darktable. I’ve tried using the new “ACM” model for lensfun (as I mentioned in my previous comment), but it turns out that neither Darktable nor RawTherapee are using a recent enough version of lensfun.
Any suggestion for workarounds?


I did some more testing and I think i found the problem with the vignetting (or at least some of it).
Sony’s explanation of the lens compensation feature includes:

Even though lens compensation will be applied to the JPEG file when shooting in RAW+JPEG, the RAW file remains uncompensated. If you wish having the corrections also applied to the RAW file, use the Sony Image Data Converter. Converted files can then be saved as lossless TIFF or as easy to handle JPEG file. 3rd party RAW converters might not be able to apply the corrections to the RAW file.

And indeed turning the shading compensation off and on had effect on the JPEGs. But it also affected the RAWs, despite what Sony says. So the vignette correction might be applied twice.

Doing a quick check it seems Adobe’s LCP + build in shading compensation works better than just the LCP. This might indicate that Adobe sampled compensated RAWs. In comparison lens fun (at least for the 50mm lens) correction gets better results if the shading compensation is off (which might be expected). However, it still over-compensates in my opinion.

This is a bummer, because if you shoot RAW+JPG you need to enable all the compensation as otherwise they won’t be applied to the JPGs.

(darix) #9

Please start here https://pixls.us/articles/create-lens-calibration-data-for-lensfun/