SGI 48bit Image Converter (Export Uncompressed)

Miscellaneous Forums/General Discussion/SGI 48bit Image Converter (Export Uncompressed)

Does anyone know of any image converters that can convert a 48bit (16 bit per channel - with 3 channels) SGI image from run length encoded to uncompressed SGI 48bit (16 bit per channel) format.

I've looked up the specification for the file format, the RLE version, and know how to read in the header, the table of offsets and lengths but in each of the descriptions I've found on the internet of the file format the code I've seen showing how they perform their run length encoding references variables with non descriptive names "iptr, optr" along with a few other tricks I cannot follow the method and so am looking for an image converter to convert the image to the uncompressed version.

Most of the converters I have found only import SGI files or they are not a command line version (which I need as if I preview/view the image in 48bit format it seems to do funny things to my screen in some image viewers as my screen bit depth is 32bits).

Reasoning behind this is that I would like to generate a depth map using 16bit per channel greyscale. An artist working with me uses 3dsMAX which can export images like that, I just need to find a way to get at the image rgb data without needing to view the image.

(and I call myself a programmer...can't even work out how to go from RLE -> Uncompressed format)....

EDIT - we either need the ability to write longer thread titles or I need to learn to be succinct.

Hmm. Well RLE is supposed to mean you have a code that says what the color is, a code which says how long to repeat it, and that's it.

AngelDaniel - I understand how the RLE method works but that is not how the SGI format does it, they use a rather different method for run length encoding. Here is a document which has the method listed on how to expand a scanline but I don't follow the important bit in the small code snippet they present:

http://www.dcs.ed.ac.uk/home/mxr/gfx/2d/RGB.txt

www.xnview.com - supports the SGI format, don't know if it supports the 16bit version, but might be worth a look.

http://www.imagemagick.org - which is a cool and handy command line tool supports the SGI format too.

And don't both GIMP and CinePaint support it. CinePaint can handle 16bit per channel format images, don't know about GIMP though (I guess it converts them to 8bit per channel on import).

Ragnar

I've had a look at these, XnView crashed whenever I tried to open an image beyond a certain size (in this case I need to open an image which is 3200x2400), it also crashed on attempting to convert any file. ImageMagick doesn't seem to support 48bit/16 bit per channel images and doesn't seem to export uncompressed SGI images.

Gimp reduces it to 8bit per channel although I haven't seen CinePaint - I will have a look at that. Thanks.

I'm having trouble getting a connection to the CinePaint website. I've found details on SourceForge.net but it seems they only have the source, not the executables (I don't own a C / C++ compiler).

The various bits of source code scattered around the web for reading these files only handles the 8bit per channel formats - and I don't understand the way their decompression algorithm works.


EDIT - I may no longer need this. We exported the image to a 16 bit per channel Targa image format, with only a single channel which seems to have done the trick. Much easier to read in a targa file which is uncompressed.

Thanks for all your help, sorry if this has been a nuisance.