Re: Problem reading depth 16 gray image.

Bob Friesenhahn <[email protected]> Mon, 16 Aug 2004 11:27:29 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.bugs
Message-ID <[email protected]>
On Mon, 16 Aug 2004, GianPiero Puccioni wrote:

> * Bob Friesenhahn <[email protected]> [040816 16:38]:
>
> [...]
>
>> The most likely cause of the problem is if your "raw" file is written
>> on an Intel machine using short int.  GraphicsMagick uses network
>> (e.g. big-endian) byte order for raw files.  If this is the cause,
>> then you would need to update your raw file writer so that it
>> specifically outputs the high byte first, followed by the low byte.
>
> I thought that was what -endian MSB/LSB did. But I tried both with no
> result. I am not sure what the source of the image is (I think it's
> generated by the software that comes with a camera or an acquisition
> board, it's all multispectral art imaging) I'll ask when the person that
> gave me the image comes back. Maybe there is a way of changing the
> output.

Unfortunately, only the TIFF format support makes use of -endian at 
the moment.

It is of course possible to extend support, but it doesn't extrapolate 
reliably to 32-bit sizes.

If you don't mind writing C or C++ code, the "ConstituteImage" and 
"DispatchImage" functions (sorry about the odd names) may be used to 
deal with arbitrary modulo8 raw formats in memory.  In order to use 
them, you would either have to read the data into memory, or use 
memory mapping to make the file available in memory.

Bob
======================================
Bob Friesenhahn
[email protected]
http://www.simplesystems.org/users/bfriesen


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285