Setting brightness/contrast on RGB image - macro gives a different output from manual

Hi,

I want to change the brightness/contrast of an RGB image by setting the lower value at 0 and the upper value at 100 using the Set button and then pressing Apply. I recorded those steps in the macro recorder.

//run(“Brightness/Contrast…”);
setMinAndMax(0, 100);
run(“Apply LUT”);

Now when I run this macro, the resulting image is brighter than when I do those steps manually. Max and Min are identical, but the means are different. I can’t figure out why this is happening. Any idea?GreenRed.tif (3.0 MB) GreenRed_macro.tif (3.0 MB) GreenRed_manual.tif (3.0 MB) Histogr_Macro Histogr_Manual

Not 100% sure, but I suspect when you are changing the display settings, one version is using a different Unsigned 16-bit range than the other. Thus, the macro is forcing a simpler calculation, resulting in fewer possible histogram values, as shown. I get something similar if I change the Unsigned 16-bit range to 8bit rather than automatic, so I am guessing the macro is somehow using 8bit. I am not sure how to change that though.
image
Yeah, pretty sure it is this, but I am not sure how to easily get the non-macro behavior.
https://imagej.nih.gov/ij/docs/guide/146-28.html