How to read SGI images in Java

In our ongoing series about Handling common image file formats 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. Unlike JDeli, ImageIO and JAI cannot read SGI images in Java.

How to read SGI images in Java?

JDeli:

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

You can find the javadocs for JDeli here. If JDeli interests you, you can find more information here.

You can find more tutorials in our series on handling common image formats in Java, JDeli and other image libraries.

If you’re a first-time reader, or simply want to be notified when we post new articles and updates, you can keep up to date by social media (TwitterFacebook and Google+) or the  Blog RSS.

Related Posts:

The following two tabs change content below.
A Java developer at IDRSolutions with 4 years of experience in Java (self-taught). Now looking forward to speaking at Java One. A knowledge seeker who likes to try out and explore new things.
Zain

About Zain

A Java developer at IDRSolutions with 4 years of experience in Java (self-taught). Now looking forward to speaking at Java One. A knowledge seeker who likes to try out and explore new things.

One thought on “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 *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>