Can you fix a heavy banding problem in my exposure?

I hope I did not come off as rude! I want to apologize if I did.

No problem, @PhotoPhysicsGuy. No offence taken.

@mike3996 showed a dark frame, which confirms that we don’t have a continuous bias within each row across the entire frame. There is a local bias. There is also, of course, random noise.

The local bias within rows might be useful for denoising. Statistics might be extracted from single frames, such as the lake scene, to do this.

A cruder method is:

Use dcraw to get the linear bayer image with no white balance or auto-orient anything:

%DCRAW% -W -r 1 1 1 1 -g 1 1 -D -d -t 0 -T -6 -O x.tiff MP003322.DNG

The result is “landscape” format. Chop the image into the four linear channels leic_R.tiff etc:

call %PICTBAT%gray2rggb x.tiff leic_XX.tiff

Now we denoise each channel as follows. We create a version that is blurred in one direction, vertically, with a Gaussian sigma of 4 pixels. Then we make an output that is the input leic_R.tiff etc but limited (clamped) to the minimum and maximum of a local 3x5 window in the blur. The min/max window could be 1x5, but making it wider reduces the obviousness of the blur.

%IMG7%magick leic_R.tiff -morphology Convolve Blur:0x4,90 +depth leic_bl_R.tiff
call %PICTBAT%limitMinMax leic_bl_R.tiff leic_R.tiff leic_nn_R.tiff 3x5

%IMG7%magick leic_G0.tiff -morphology Convolve Blur:0x4,90 +depth leic_bl_G0.tiff
call %PICTBAT%limitMinMax leic_bl_G0.tiff leic_G0.tiff leic_nn_G0.tiff 3x5

%IMG7%magick leic_G1.tiff -morphology Convolve Blur:0x4,90 +depth leic_bl_G1.tiff
call %PICTBAT%limitMinMax leic_bl_G1.tiff leic_G1.tiff leic_nn_G1.tiff 3x5

%IMG7%magick leic_B.tiff -morphology Convolve Blur:0x4,90 +depth leic_bl_B.tiff
call %PICTBAT%limitMinMax leic_bl_B.tiff leic_B.tiff leic_nn_B.tiff 3x5

Now we have four denoised images, we average the greens and apply a simple white-balancing, combine the channels, and convert from linear RGB to non-linear sRGB:

%IMG7%magick ^
  ( leic_nn_R.tiff -evaluate Multiply 2.47 ) ^
  ( leic_nn_G0.tiff leic_nn_G1.tiff -evaluate-sequence Mean ) ^
  ( leic_nn_B.tiff -evaluate Multiply 1.09 ) ^
  -combine ^
  -set colorspace RGB -colorspace sRGB ^
  +write leic_srgb.tiff ^
  -equalize ^
  leic_eq.tiff

I show a JPEG of the equalised version, leic_eq.tiff:


The result is not perfect. In the equalised version, some trace of the original banding is still visible, but it is massively reduced. Instead, we get some blurring in a direction parallel to the horizon. I suggest this isn’t an aesthetic problem in the water or clouds. It is a problem in the distant lights; a mask could solve that problem.

3 Likes