How to convert TIF to PNG in Java?

What is the best way to convert TIF files to PNG in Java?

Simplicity is desirable, but if the easiest way is to use a third-party library, I will consider this solution

Solution

First, install jai Then install Jai / imageio Then execute

public static void main(final String[] args) throws Exception
{
    final BufferedImage tif = ImageIO.read(new File("test.tif"));
    ImageIO.write(tif,"png",new File("test.png"));
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>