Zain Zain is a Java developer. His is a knowledge seeker who likes to try out and explore new things.

How to read SGI images in Java

43 sec read

In our ongoing series about reading and writing image files in Java we move our focus onto how we can read SGI images in Java.

What is SGI?

SGI ImageSGI (Silicon Graphics Image) is a file type of images with the extensions .sgi and .rgb. It has 2-channel support (.bw for black and white), 3-channel support (rgb/bwa) and 4-channel support (rgba). The ‘a’ represents alpha.

There are not many libraries out there that can read SGI images. Our JDeli Image library can read and write a very wide range of image formats, including SGI.

How to read SGI images in Java?

JDeli:

//Read Image (can also be OutputStream or byte array)
File sgiFile = new File("sgiImage.sgi"); 
BufferedImage image = JDeli.read(sgiFile);

Or you can use the JDeli SgiDecoder directly:

SgiDecoder decoder = new SgiDecoder();
BufferedImage image = decoder.read(rawImageBytes);

Javadoc and Download

Why use JDeli?

JDeli offers a range of advantages over ImageIO and alternatives, including:

  • prevents heap related JVM crashes
  • implements unsupported image formats
  • reduce output file size
  • improve read/write performance
  • supports threading
  • superior image scaling algorithms

Learn more about JDeli, or download to try it yourself.

This article is part of our series on reading and writing image files in Java.

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

Zain Zain is a Java developer. His is a knowledge seeker who likes to try out and explore new things.

One Reply to “How to read SGI images in Java”

  1. As ImageIO is plugin based, I have written a plugin for the SGI format, that allows ImageIO to read SGI images as easy as:

    BufferedImage image = ImageIO.read(sgiFile);

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2019. All rights reserved.