I have a large swing component for writing to TIFF. The component is too large to load TIFF into memory, so I need to either create a large BufferedImage that is supported by Disk WritableRaster (as mentioned here ), or use JAI.
JAI seems like the best answer, except for the complete confusion of the project.
Given, can anyone outline the steps for writing my tiling component in tiled TIFF without running out of memory?
Image size can be 10000x700
Ideally, I would create some kind of disk-based image and write parts of the component to it, each record was flushed to disk.
EDIT
I think I can do this with ImageWriter, but I get a NoSuchElementException on call:
ImageWriter imageWriter = ImageIO.getImageWritersByFormatName("tif").next();
I have jai_code.jar and jai_core.jar jars in my classpath, is there anything else I need to do?
EDIT
I can create very large TIFFs using JAI, but JAI does not support TIFF compression, so the file is 92 MB in size.
If I install JAI-ImageIO, I can create compressed TIFF using ImageWriter, but only from Raster or BufferedImage, for which I do not have enough memory.
Is there a way to take a two-step approach, use the JAI to create a large TIFF, and then compress the large TIFF without loading it all into memory?