darktable - correcting blue/purple fringing (drawn mask in style or preset?)

Hello all,

So the start of the story is that I’m looking for a decent pocket camera and it looks like a choice between the Canon G5X II and the Sony RX100 3/4/5. The Canon looks like it would be much more fun to use, but it suffers from severe blue/purple fringing in the corners at wide angle. Not sure exactly what species of CA this is, but it only affects the corners and cannot be corrected with the channel scaling TCA correction in lensfun. The OOC JPEGs look fine for a compact camera, so it is certainly correctable. Ideally there will be a nice way to it in darktable, but I’m struggling a bit.

Here is an example:

It actually extends maybe 20% into the frame.

The “chromatic aberrations” module in darktable can clean it up quite well:

But this requires both radius and strength to be increased significantly, and there’s a lot of collateral damage, as you would expect (i.e. complete desaturation of small, brightly coloured things across the frame). An elliptical drawn mask that limits the effect to the corners (possibly combined with a parametric mask limiting it to blue things) looks like a pretty good compromise that would work in most cases. Any other ideas for how to tackle it?

The next thing is how to get it into a convenient workflow. My first thought was to create a preset and auto-apply it to images matching the camera and a focal length range, or to create a style and manually apply it. But it looks like drawn mask information can’t be saved as part of a style or preset - the module settings get applied with “drawn and parametric mask” blend mode but no drawn mask. Copying and pasting the history stack does seem to work, though. This isn’t actually too bad a workaround but can anyone see a better way to do it that I’m missing?


Hi @benp

I will highly recommend to watch this video:


Try changing or turning off the preserve chrominance setting in filmic, if it’s enabled. Sometimes it can make the blue fringing more noticeable.

Thanks @s7habo for the link and @rawfiner for the very useful video. I think I’m on the right track with the CA module plus masking. The aberration is so extreme on this particular lens that, while the CA module can deal with it, it doesn’t seem to be possible to control it without desaturating other details. Limiting the effect to the corners and blue hues with a drawn + parametric mask is a good compromise that works well on the (limited number of) samples I’ve tried.

So the second question - I would like to apply this correction automatically to all images matching the camera and focal length range. I think that’s not possible, because the drawn mask is not stored in presets/styles. It is copied when you copy/paste the history stack, though. So I would correct one image then select by focal length and copy/paste to others. Not too bad… but is there a better way?


1 Like

Thank you, this is a good point I hadn’t been aware of until I watched the video. It did have a minor effect but was not a significant factor in this case.