I want to find to separate multi tiff files to png or jpg in Java.

I tried JAI, but it has a lot of bug something, especially with jpeg-2000.

so I want to find another third-party library.

1 Answer 1


You can use LEADTOOLS Imaging Pro SDK technology in your application. https://www.leadtools.com/sdk/formats

You can leverage the RasterCodecs class, to loop through each page of a multi-page TIFF file and export each page individually to any LEADTOOLS supported file format (PNG, JPEG, BMP, etc.).

DISCLOSURE: I am an employee of the company offering this toolkit.

Here is some sample code:

String multipageFile = "FILE PATH TO MULTIPAGE FILE";
RasterCodecs codecs = new RasterCodecs();
int totalPages = codecs.getTotalPages(multipageFile);
for (int page = 1; page <= totalPages; page++)
    String outputFile = "<EXPORT_DIR>\\SplitTiff(page" + page + ").png";
    RasterImage image = codecs.load(multipageFile, page);
    codecs.save(image, outputFile, RasterImageFormat.PNG, image.getBitsPerPixel()); // Change to RasterImageFormat.JPEG for .jpg

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.