How imagej convert 16bit to 8bit?

Dear forum
Does someone know which math function is used in ImageJ to convert 16bit grayscale to 8bit grayscale?
The one used by Menu->Image->Type->8bit


Here is the Java source:

thanks some ignorance here…
what (pixels16[i]&0xffff) will do?

The bottom line of this question is to replicate the 16bit to 8bit conversion in Matlab.


See also:

1 Like