Complete BigBufferedImage solution. It can load and store much larger images than the memory limit. The trick is that its buffer is replaced by a file implementation of DataBuffer. It saves the image on the hard drive. RAM is not used. This may prevent an OutOfMemoryException.
Create the BigBufferedImage file from the image file:
BigBufferedImage image = BigBufferedImage.create( inputFile, tempDir, TYPE_INT_RGB);
Create an empty BigBufferedImage:
BigBufferedImage image = BigBufferedImage.create( tempDir, width, height, TYPE_INT_RGB);
Display part of image:
part = image.getSubimage(x, y, width, height);
For more information on large image processing, read this article .
Jhead
source share