Lens distortion correction causing banding

I’m relatively new to darktable (coming from Lightroom) and I’m starting to feel at home with the workflows and processes, but I was processing some night-time city scape photos tonight and can’t seem to fix a banding issue with my photos. After a lot of trial and error I found out it was the lens distortion correction causing it.

From the two exports attached, you can see this odd banding kind of waves of noise across the sky. One is with all setting for lens correction, the other is vignetting + TCA only



20230204_0358.ARW (41.2 MB)

It’s a known effect of the combination of noise and lenscorrection:

I don’t know if there has occured a better solution in the recent past, but you can try to cover it a bit with specific NR settings. Tbh this could be hard since at least with my default settings, the effect is pretty much not visible in the darkroom but in the exported image.

I don’t get the banding with your sample. Do you have the xmp file?

Yeah, it’s very slightly visible in darkroom for me, but very visible on the exported files.

Thanks for that link, I hadn’t been able to find people with the same issue yet. The settings in that thread do get rid of the banding, but they lose most of the detail on buildings and such as well :frowning:

Yeah, sure. Here’s an xmp showing the banding
20230204_0358_06.ARW.xmp (9.1 KB)

Just seen that dehaze makes it much more visible in the darkroom. I must admit, I can’t really find usable settings for the photo so far.

Yeah, I should get to bed; I’ve been trying to figure this out for hours now with minimal luck. I think I need to try again tomorrow with a clean pipeline and see what works. Also, good catch on the dehaze! It definitely made it worse. A few things I did find though:

  • disabling lens distortion correction stops it happening (ok for this kind of landscape I suppose)
  • ramping up noise reduction until it looks like I took this on a Nokia circa 2010 also “fixes” this
  • removing dehaze helped considerably
  • Embedded lens profile is resulting in darkened corners (~0.1 ev), lensfun is slightly too bright in the corners, both of which make it a bit more noticable - using vignette filter to counter it works ok
  • Adding a second profiled denoise and masking it to the sky/dark areas is another option
  • Next time I’ll bring my tripod to more places so I don’t need to use high ISO
1 Like

Can you take a similar picture with lens cap on and upload? Same exposure settings. I am thinking about something I read at dpreview about black levels in green channels, but Sony doesn’t have any optical black area to use why a black raw file is needed instead.

This is a known issue with noise and lens distortion correction, even in Lightroom there’s a recent thread on dpreview on a similar issue. Noise reduction can remove/greatly reduce the effect.

Yeah, of course. Here you go. I set the focus just on infinite, I have a feeling the original might’ve been a touch closer in as this lens stops to ~500m prior to infinite.

2023-02-06_0004.ARW (40.8 MB)

No luck. I got wrong black level 128 instead of around 512 with Hraw.

Thanks for trying. So, in the end I ended up running two profiled denoise modules; one on local mean, which left splotchy chroma noise still, which I cleaned up with the second one using wavelets (with ~4-5 bias correction to remove the yellow hue it seems to leave behind).

This got rid of the noise sufficiently, but in the darker parts of the image it significantly impacted the finer details that I’m struggling to get back.

I played around with topaz denoise as well and that does a phenomenal job of removing the noise but leaving the detail in-tact and it runs fine under wine (on CPU only); so I’m considering that as an option.

Converted your ARW to DNG in Adobe DNG Converter and got the right black level this time.
513
513
513
513

But no difference.

I tried your file in PureRAW with its lens correction and the corners are too bright.

For what its worth, I often only enable the corrections that are needed in lens correction - so for this one I might just enable CA correction and maybe vignetting… doesn’t help though on an image where you really need the geometric correction.