I'm currently working on a Java program (part of my master thesis) that automatically identifies and crops document pages in digital images. The digital images that the program is supposed to read, are stored (and will by default be generated) as tiff files.
To avoid having a step of manually converting the files to another format (currently png), I would like to be able to read the tif files directly. From what I can understand, this functionality is not included in the standard libraries. And unfortunately JAI does not seem to have any support for x64 systems.
Is there a simple solution to this problem that I might have overlooked?
Great, I was able to make it work!
However, it seems I must change some part of my implementation. When I run the following code it takes well over 20 seconds to load and display the image (1800x2800 pixels). Also, using my existing code for image scaling, an exception occurs which says that the image type (=0) is unknown.
However, the scaling works if I instead copy the data from the original image to another BufferedImage and apply the scalning transform on the latter. The image is now loaded and displayed almost instantly, even without scaling. But is there a better solution to this problem? The current work around feels kind of "ugly".