You want to download the JAI Image I / O Tools , which provides ImageIO adapters for JAI. Once you have installed this, it will be smooth.
final BufferedImage in = ImageIO.read(new File("frabozzle.tif")); final BufferedImage out = new BufferedImage( in.getWidth(), in.getHeight(), BufferedImage.TYPE_BYTE_GRAY); out.getGraphics().drawImage(in, 0, 0, null); ImageIO.write(out, "TIFF", new File("graybozzle.tif"));
source share