Converting high bit-depth Image to Composite with the same bit-depth

While using the feature of Image > Color > Channels Tool , the bit depth of the image is changing from 16 bits/Pixel to 8 bits/Pixel (Color LUT) and this caused a very slight change in using Particle Analyzer.

IJ.run("Channels Tool...");
ImagePlus imp2 = CompositeConverter.makeComposite(imp);

Is there a way that I am not aware of where I can have an LUT with the same bits/pixel for each channel?

Hi @Mourka

Do you have the ImageJ source code?

In https://github.com/imagej/imagej1/blob/22c63c0ac3a82eb86210508cb4632f3556bd796c/ij/plugin/CompositeConverter.java you can find that for images with bitdepth <> 24 you have to use something like

CompositeImage ci = new CompositeImage(imp, CompositeImage.COMPOSITE);
if (imp.getBitDepth()!=8) {
	ci.reset();
	ci.resetDisplayRanges();
}
ci.show();

( IJ.run(“Channels Tool…”) can be skipped. )

1 Like