Java JAI ImageIO: read from tiff and write to bmp

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.bmp");
  BufferedImage image =;
  BufferedImage convertedImage = new BufferedImage(image.getWidth(), 
      image.getHeight(), BufferedImage.TYPE_INT_RGB);
  convertedImage.createGraphics().drawRenderedImage(image, null);
  ImageIO.write(convertedImage, "bmp", outputFile);



No comments:

Post a Comment