You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The background is two light gray values. I expect both to become brighter.
The foreground is darker gray values, I expect these to touch black.
Histogram stretching until the outermost gray values hit 0 and 255 respectively.
Then some more linear stretching so that the outermost gray values would go 2 percent beyond, ca -5 and 260, then clip everything back to be within 0..255
What actually happened?
The background is half black 0x000000 and half white 0xffffff. That is unexpected.
The darker gray of the background is in any case more than 2% percent brighter than the darkest point of the foreground. (Or we must be measuring very non-inear)
What versions of Pillow and Python are you using?
python-3.6 with Pillow-5.2.0
The text was updated successfully, but these errors were encountered:
This function calculates a histogram of the input image (or mask region), removes cutoff percent of the lightest and darkest pixels from the histogram, and remaps the image so that the darkest pixel becomes black (0), and the lightest becomes white (255).
I think your expectation is that the cutoff would apply after scaling, whereas Pillow is applying it before scaling. This behaviour is what is described in the documentation, so I don't think there's anything to do here.
What did you do?
python-3.6 with Pillow-5.2.0
Download this image as leaf-gr.jpg then start python and do
What did you expect to happen?
The background is two light gray values. I expect both to become brighter.
The foreground is darker gray values, I expect these to touch black.
Histogram stretching until the outermost gray values hit 0 and 255 respectively.
Then some more linear stretching so that the outermost gray values would go 2 percent beyond, ca -5 and 260, then clip everything back to be within 0..255
What actually happened?
The background is half black 0x000000 and half white 0xffffff. That is unexpected.
The darker gray of the background is in any case more than 2% percent brighter than the darkest point of the foreground. (Or we must be measuring very non-inear)
What versions of Pillow and Python are you using?
python-3.6 with Pillow-5.2.0
The text was updated successfully, but these errors were encountered: