saving binary as 1 bit-per-pixel tif
Posted by Jan Eglinger-5 on Sep 06, 2009; 11:40am
URL: http://imagej.273.s1.nabble.com/saving-binary-as-1-bit-per-pixel-tif-tp3691279.html
Dear all,
I tried to save a binary mask as a 1-bit-per-pixel file using "File>Save
As>Compressed TIFF ...".
After confirming that I want to save it using 1 bit per pixel, I get the
following error message:
java.lang.IllegalArgumentException: Input ByteProcessor has to have
index color model with map size of 2, got 256.
at
net.sf.ij.jaiio.BufferedImageCreator.createBinary(BufferedImageCreator.java:102)
at
net.sf.ij.jaiio.BufferedImageCreator.create(BufferedImageCreator.java:77)
at net.sf.ij.jaiio.JAIWriter.write(JAIWriter.java:143)
at
net.sf.ij.plugin.ImageIOSaveAsPlugin.write(ImageIOSaveAsPlugin.java:237)
at net.sf.ij.plugin.ImageIOSaveAsPlugin.run(ImageIOSaveAsPlugin.java:207)
[...]
I already tried editing the LUT to contain only 2 colours, and choosing
different compression methods... I guess the problem is that the image
still has 256 grey levels (of which only 0 and 255 are used).
How can I reduce the map size to 2?
Is there any other memory-saving way of saving big binary images?
Thanks,
Jan