/** Creates an SGIImage from the specified data in either RGB or RGBA format. */ public static SGIImage createFromData( final int width, final int height, final boolean hasAlpha, final byte[] data) { final Header header = new Header(); header.xsize = (short) width; header.ysize = (short) height; header.zsize = (short) (hasAlpha ? 4 : 3); final SGIImage image = new SGIImage(header); image.data = data; return image; }