Java JAI ImageIO: read tiff file and save it to png

package examples;

import java.awt.image.BufferedImage;

import javax.imageio.ImageIO;

public class ImageUtil {
 public static void main(String[] args) throws Throwable {

  File inputFile = new File("/tmp/1.tif");
  File outputFile = new File("/tmp/1.png");
  BufferedImage image =;
  ImageIO.write(image, "png", outputFile);




you need to make sure jai_imageio.jar is in the classpath. To install jai imageio on Mac OS X see here.

No comments:

Post a Comment