How to Read an Image from a TIFF File with Oracle JDK

import java.util.Iterator;

import javax.imageio.ImageIO;
import javax.imageio.ImageReader;

public final class TiffSample {

  public static void main(final String[] args) throws Exception {
    final Iterator<ImageReader> it = ImageIO.getImageReadersByFormatName("tiff");

    if (it.hasNext()) {
      final ImageReader reader =;

      final ImageInputStream input = new FileImageInputStream(new File("image.tiff"));


      reader.readAll(0, null); // for the first image



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.