Re: Problem reading depth 16 gray image.
Bob Friesenhahn <[email protected]> Mon, 16 Aug 2004 09:33:10 -0500 (CDT)
| Newsgroups | gmane.comp.video.graphicsmagick.bugs |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 16 Aug 2004, GianPiero Puccioni wrote: >>> but I'd like to do some processing with GM. >>> >>> Am I doing something wrong? >> >>> From looking at the supportive code, I suspect that your >> GraphicsMagick is built with QuantumDepth=8. It appears that if >> GraphicsMagick is built with less depth than the image being read, it >> is likely to produce an all-black image since the input quantums are >> not down-scaled and therefore will exceed the colormap index range >> (gray images are read as PseudoClass) and be reset to zero (black). > > Yes I did build GM with the default QuantumDepth=8, I tried to rebuild > it using --with-quantum-depth=16 and the results are different but still > wrong, now it seems mostly random noise, maybe only the LSB is used? > By the way that was the same result I had with the old ImageMagick I had > around. 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 can send you an image but it's rather big (2MB) you can get it from > http://www.ino.it/~gip/files/images/uv600_360.raw I have downloaded your image. >> I do plan to substantially re-write the code which supports this so >> that a QuantumDepth=8 GraphicsMagick can still usefully read 16-bit >> images (but loosing 8 bits of resolution). > > If you mean for showing the image, it's no problem, the human eye doesn't > even see 256 levels of grey so not having 65.000+ is fine. But if > internally for elaboration and other stuff all 16 bits could be kept > that would be better. Right. The intention is that a QuantumDepth=8 GraphicsMagick can read deep images, but with less color/gray resolution. 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