Page 1 of 2
question - Equalize transformation and banding in output image
Posted: June 15th, 2024, 8:25 pm
by pierrelabreche
The Equalize transformation produces banding in the output image, as visible on histograms.
This banding effect is not present when using 16-bit grayscale or 48-bit color images as input.
I tried to reproduce the banding effect using the test pattern "cosine falloff".
Question : is there a problem with the Equalize transform when the component planes are 8-bits, or is it recommended to convert to 16-bits planes before applying Equalize, to prevent gaps in the histogram ?
Banding is not present if
- an 8-bit or 24-bit image is first converted to 16-bit or 48-bi,
- equalize performed, and
- the result is converted back to 8-bit or 24-bit.
See screenshots below
![2024-06-15 PWP equalize transformation with banding per histogram, 8-bitsgrayscale .jpg](./download/file.php?id=1853)
- 2024-06-15 PWP equalize transformation with banding per histogram, 8-bitsgrayscale .jpg (45.46 KiB) Viewed 928 times
![2024-06-15 PWP equalize transformation with continuous histogram, 8-bits grayscale .jpg](./download/file.php?id=1852)
- 2024-06-15 PWP equalize transformation with continuous histogram, 8-bits grayscale .jpg (47.3 KiB) Viewed 928 times
Test workflow:
Re: question - Equalize transformation and banding in output image
Posted: June 15th, 2024, 8:33 pm
by jsachs
Any very steep curves such as the ones in your example are likely to produce banding. Not all curves created by Equalize as as extreme as this example, but I recommend using 16-bit images whenever possible to reduce posterization.
Re: question - Equalize transformation and banding in output image
Posted: June 15th, 2024, 9:01 pm
by pierrelabreche
What I find unusual is that the results are very different when Equalize is applied to 16-bit images.
Compare:
- 8-bit image -> Equalize
- 8-bit image -> convert to 16 bits -> Equalize -> convert back to 8 bits
Could the banding be due to floating point quantization or integer calculations rounding error ?
Re: question - Equalize transformation and banding in output image
Posted: June 16th, 2024, 5:34 pm
by jsachs
Equalize simply computes the curve necessary to more or less match a given histogram. Then it applies the curve to the input image just like Brightness Curve. When PWP converts images from 8-bit to 16-bit it fills the extra bits with random data. This is a standard signal processing technique call dithering. Thus the 16-bit image has a more even distribution of values, not just the original 256. I assume this is what makes the difference when you apply steep curves and then convert back to 8-bit.
Re: question - Equalize transformation and banding in output image
Posted: June 17th, 2024, 11:51 am
by pierrelabreche
There is one thing that I find intriguing.
1. The input image appears to have a continuous histogram without banding gaps.
2. When the amount control in the transformation is in the middle scale, say 25%, I would expect the output to be a blend of the input weighted at 25% and the transformation's output weighted at 75%. I do not understand why there would be banding in the output histogram.
See screen shots, below and in additional replies to work around the 3 attachments limitation.
![vlcsnap-2024-06-17-11h32m22s126.jpg](./download/file.php?id=1857)
- vlcsnap-2024-06-17-11h32m22s126.jpg (34.84 KiB) Viewed 897 times
![vlcsnap-2024-06-17-11h33m43s347.jpg](./download/file.php?id=1858)
- vlcsnap-2024-06-17-11h33m43s347.jpg (53.7 KiB) Viewed 897 times
![vlcsnap-2024-06-17-11h34m40s800.jpg](./download/file.php?id=1859)
- vlcsnap-2024-06-17-11h34m40s800.jpg (55.63 KiB) Viewed 897 times
Re: question - Equalize transformation and banding in output image
Posted: June 17th, 2024, 11:52 am
by pierrelabreche
![vlcsnap-2024-06-17-11h35m21s817.jpg](./download/file.php?id=1860)
- vlcsnap-2024-06-17-11h35m21s817.jpg (59.72 KiB) Viewed 897 times
![vlcsnap-2024-06-17-11h36m02s653.jpg](./download/file.php?id=1861)
- vlcsnap-2024-06-17-11h36m02s653.jpg (56.53 KiB) Viewed 897 times
![vlcsnap-2024-06-17-11h36m37s416.jpg](./download/file.php?id=1862)
- vlcsnap-2024-06-17-11h36m37s416.jpg (55.39 KiB) Viewed 897 times
Re: question - Equalize transformation and banding in output image
Posted: June 17th, 2024, 11:54 am
by pierrelabreche
![vlcsnap-2024-06-17-11h36m37s416.jpg](./download/file.php?id=1863)
- vlcsnap-2024-06-17-11h36m37s416.jpg (55.39 KiB) Viewed 897 times
![vlcsnap-2024-06-17-11h36m47s773.jpg](./download/file.php?id=1864)
- vlcsnap-2024-06-17-11h36m47s773.jpg (57.85 KiB) Viewed 897 times
![vlcsnap-2024-06-17-11h37m03s145.jpg](./download/file.php?id=1865)
- vlcsnap-2024-06-17-11h37m03s145.jpg (49.74 KiB) Viewed 897 times
Re: question - Equalize transformation and banding in output image
Posted: June 18th, 2024, 9:42 pm
by pierrelabreche
I should have written :
There is one thing that I find intriguing.
1. The input image appears to have a continuous histogram without banding gaps.
2. When the amount control in the transformation is in mid-scale, say 75%, I would expect the output to be a blend of the input weighted at 25% and the transformation's output weighted at 75%. I do not understand why there would be banding in the output histogram.
Re: question - Equalize transformation and banding in output image
Posted: June 19th, 2024, 7:17 am
by jsachs
Because the output image has banding before it is blended with the input image.
Re: question - Equalize transformation and banding in output image
Posted: June 19th, 2024, 6:24 pm
by pierrelabreche
Because the output image has banding before it is blended with the input image.
Thank you. I was under the impression that because the input was continuous, the blended output should also be.
I found with further investigation that the output histogram is indeed continuous in the transformation dialog box, but not in the histogram mode display.
Equalize transform: Output Curve
The output curve displays the curve that Equalize applies to the input image to create the output image. The histogram in the background is the histogram of the output image.
Histogram mode : Input/Output Image Histograms
When a transformation dialog box is open, the histogram is computed from either the input or the output image. If the display tool bar at the top of the dialog box is set to show just the input image, the histogram is computed from the input image. Otherwise the histogram is computed from the output image
See screenshot below, where there is a discrepancy between the two histograms.
Shouldn't both histograms be similar, because they both represent the preview/output image ?
![2024-06-19 Equalize results on Cosine falloff - histograms discrepancy.jpg](./download/file.php?id=1866)
- 2024-06-19 Equalize results on Cosine falloff - histograms discrepancy.jpg (55.01 KiB) Viewed 855 times