如何在Java中将TIF转换为PNG? [英] How do I convert a TIF to PNG in Java?
本文介绍了如何在Java中将TIF转换为PNG?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Java下,将TIF文件转换为PNG的最佳方法是什么?
Under Java what is the best way to go about converting an TIF file to a PNG?
简单是优选的,但如果最简单的方法是使用第三种派对图书馆然后我会考虑解决方案。
Simplicity is preferable, but if the simplest way is to use a third party library then I would consider that solution.
推荐答案
首先,安装 JAI 。然后安装 JAI / ImageIO 。然后执行
First, install JAI. Then install JAI/ImageIO. Then do
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"));
}
这篇关于如何在Java中将TIF转换为PNG?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文