Re: Problem reading depth 16 gray image.
GianPiero Puccioni <[email protected]> Mon, 16 Aug 2004 12:46:05 +0200
| Newsgroups | gmane.comp.video.graphicsmagick.bugs |
|---|---|
| Message-ID | <[email protected]> |
* Bob Friesenhahn <[email protected]> [040813 20:11]: > On Fri, 13 Aug 2004, GianPiero Puccioni wrote: > > > I have some images in raw format 16 bits per pixel and when I try to > > read them with > > > > gm display -depth 16 -size 1024x1024 gray:b400_02.RAW > > > > I get a completely black image. The images are fine as I can read them > > with a C program I wrote myself to reduce to 8 bits and display them, > > 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). > Hi, 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. 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 or just tell me and I'll send it by E-Mail. > 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. Thanks for the help. GianPiero ------------------------------------------------------- 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