IImage I/O library implements core functionality of ij-plugins Image I/O bundle. The library adds to ImageJ support for additional image file formats and their variants. Most important additions include:
Reading of compressed and tiled TIFF files
Reading of TIFF images with 1 bit, 8 bit, 16 bit, 32 bit, and float pixel formats from compressed and tiled files. Images are converted to closest corresponding ImageProcessor representation (). Note that related set of JIMI plugins converts all images to 8 bit images (ByteProcessor) regardless of their actual pixel formats and does not support tiled images.
Saving as compressed TIFF; supports Packbit, JPEG, and ZIP compression. Saving with LZW compression is not supported for the usual reason of the patent on the algorithm.
Saving of binary images in 1 bit compressed TIFF format. Compared to saving as uncompressed 8bit images can get 1:100 or higher compression ratios.
Image I/O plugins can read/write image calibration information from TIFF files. Standard TIFF image calibration tags are supported (X_RESOLUTION, Y_RESOLUTION, RESOLUTION_UNIT).
Additionally Image I/O can read images in BMP, FlashPiX, GIF, JPEG, PNG, and PNM formats; and save images in BMP, and JPEG formats.
Image I/O makes use of Java Advanced Imaging (JAI) codecs released by SUN as uncommitted source code for JAI 1.1.1 codecs . The plugin bundle is completely self contained. All used codec classes are included in the bundle and there is no need to install JAI itself to use the bundle.
Reading of images using Image IO library is very simple, an image can be read with a single line of code:
ImagePlus images = JAIReader.read("data/clown_LZW.tif");
Note that JAIReader.read() returns an array of images. In general, image file like TIFF support storing multiple image in a single file - each image can be of a different type. If an image file contains a single image or all of the images are of the same type and size, JAIReader.read() will return a single element array. JAIReader.read() interprets images of the same type and size as slices in a single image stack.
For the complete example see SimpleReadImage.java in subdirectory example/src or online.
ImagePlus imp = ... JAIWriter jaiWriter = new JAIWriter(); jaiWriter.setFormatName("PNG"); jaiWriter.write("myimage.png", imp);
To see of using Image IO library in Image/J plugins code see implementations of plugins based on ImageIO available in the Image IO source code.
Documentation for ij-plugins Image I/O library is available here.