In the screenshot below, a gray wedge is equalized flat.
The blacks are not equalized as expected. The oroginal black ( 0% ) is brightened to an HSV-V value of 8,6.
Equalized step wedge output
Script is attached
Issue : Equalize transformation unexpectedly brightens the blacks
Moderator: jsachs
-
- Posts: 548
- Joined: January 29th, 2019, 11:47 pm
- What is the make/model of your primary camera?: Nikon Z8
Re: Issue : Equalize transformation unexpectedly brightens the blacks
There are spikes in the input image histogram at white and black, presumably due to the borders between the patches. If you use a linear gradient as the input image instead I think you will see what your were expecting.
Jonathan Sachs
Digital Light & Color
Digital Light & Color
-
- Posts: 548
- Joined: January 29th, 2019, 11:47 pm
- What is the make/model of your primary camera?: Nikon Z8
Re: Issue : Equalize transformation unexpectedly brightens the blacks
The large black patch ( 0% ) should be taken into account in the equalization process. The value of pure black in the output image, i.e. after equalization , should remain pure black.
The spikes are due to the uniform patches and white text.
The resulting range of values appears biased away from black.
Will experiment later with gradient.
The spikes are due to the uniform patches and white text.
The resulting range of values appears biased away from black.
Will experiment later with gradient.
Re: Issue : Equalize transformation unexpectedly brightens the blacks
>>The large black patch ( 0% ) should be taken into account in the equalization process. The value of pure black in the output image, i.e. after equalization , should remain pure black.
That's not how it works. The first non-zero output histogram value is biased toward white to reduce the excess amount of pure black from the labels and borders in the input image.
When you test with Linear Gradient, make sure you set the transition between black and white to Line and not Sine.
That's not how it works. The first non-zero output histogram value is biased toward white to reduce the excess amount of pure black from the labels and borders in the input image.
When you test with Linear Gradient, make sure you set the transition between black and white to Line and not Sine.
Jonathan Sachs
Digital Light & Color
Digital Light & Color
-
- Posts: 548
- Joined: January 29th, 2019, 11:47 pm
- What is the make/model of your primary camera?: Nikon Z8
Re: Issue : Equalize transformation unexpectedly brightens the blacks
I did one more experiment with the grey step wedge, whereby I applied a gray curve to the input image so that it is not pure black, just to see if pure black was especially ignored. Quoting the help for Equalize:
The Equalize curve is flat, that is, all tones between pure black and pure white are desired to be equally distributed. The output histogram is showing that tonal values in the output image are not equally represented. The black tones which are largely present, as shown with the left peak in the input histogram, are absent in the output image's tonal range.Standard histogram equalization works by trying to adjust the image to a flat curve as illustrated below. This causes each tonal values in the output image to be roughly equally represented,
The experiment shows that even with dark grey ( HSV-V = 2 ), the output histogram remains tilted towards whites.
Gradient experiments to follow.
-
- Posts: 548
- Joined: January 29th, 2019, 11:47 pm
- What is the make/model of your primary camera?: Nikon Z8
Re: Issue : Equalize transformation unexpectedly brightens the blacks
I experimented using a test pattern consisting of a a pure gradient. The results are identical after equalization, as expected.jsachs wrote: ↑June 20th, 2024, 6:50 am >>
That's not how it works. The first non-zero output histogram value is biased toward white to reduce the excess amount of pure black from the labels and borders in the input image.
...
When you test with Linear Gradient, make sure you set the transition between black and white to Line and not Sine.
I then created another experiment with a pattern involving all tones by applying the linear gradient to a Star test pattern, using Hard light.
The resulting pattern is well-balanced : it consists of light and dark tones instead of the pure black and white original star pattern.
The results are shown below.
The equalize transformation treats differently the light and the dark tones. Probing the pure black shows it is substantially lightened, whereas the whites are not darkened to the same degree. There is a noticeable step tonal change at the 0 and 180 degrees rays.
- Attachments
-
- 2024-06-27 PWP8 Equalized Test pattern Star with gradient-hard light - resized.jpg (125.46 KiB) Viewed 812 times