Hi,
I am trying to set Lut file on the image (.tif) using the below code
ImagePlus imp1 = IJ.openImage("C:\\Users\\insmohamma\\Desktop\\Python_test\\original images\\images\\test_image.tif");
LUT lut1 = LutLoader.openLut("C:\\Users\\insmohamma\\Desktop\\Python_test\\original images\\Rainbow_RGB.lut");
imp1.getProcessor().setLut(lut1);
new FileSaver(imp1).saveAsJpeg("C:\\Users\\insmohamma\\Desktop\\Python_test\\original images\\Rainbow\\test_image.tif");
This code is working fine and able to apply LUT on a few images. However, I am getting below exception for few other images (which are actual images on which I wanted to apply it),
Exception in thread “Run$_main” java.lang.IllegalArgumentException: DirectColorModel required
at ij.process.ColorProcessor.setColorModel(ColorProcessor.java:102)
at ij.process.ImageProcessor.setLut(ImageProcessor.java:192)
at LUT_Apply.applyRainbowLUT(LUT_Apply.java:30)
at Test.main(Test.java:12)
Please help me on the same, I am struggling last 7 days.