Display range affects pixel values during type conversion

I’m using Fiji (ImageJ 2.0.0-rc-69/1.52n 64-bit) on Windows 10 64-bit - although I expect this isn’t version-specific. More likely this is a misunderstanding on my part about how some things work behind the scenes.

I’m processing 32-bit float TIFF stacks using 3D projection (MIP), and noticed some inconsistent results. I see that the output of that process is 8-bit, and have narrowed down the source of my problems to that conversion. Playing around with the conversion from 32-bit float to 8-bit, I noticed the following: if I adjust the image display via Image>Adjust>Brightness/Contrast - using the auto setting, but NOT applying the change - it affects the subsequent conversion to 8-bit.

For example, without Brightness/Contrast adjustment:

and with Brightness/Contrast adjustment:

The histogram of the original image doesn’t change, which is the behavior I expected. However, the histogram of the resultant 8-bit image does seem affected.

I dug through the code a bit but figured it might be faster to just ask here! Thanks in advance!

It’s been a while since I wrote this but I think it’s still the case… although if you find it has changed, please let me know!


This is exactly what I need! Thanks for your reply, and thanks for this resource. I expect there’s plenty more for me to learn there.