Page 1 of 1

Magick++ : How to get 10 bit raw data from 16 bit TIFF

Posted: 2007-10-05T18:25:54-07:00
by celios
I have a set of 16 bit TIFF and need to convert it to 10 bit, take the raw pixel data, then assign the 10 bit raw data
to my company's proprietary video format which is 10 bit.
How do I get the 10 bit raw data using Magick++ (MagickWand implementation is also welcomed) ?

So far I have tried :
1. calling Image::depth() with parameter 10
2. either one of these :
- use Image::getPixels() to get PixelPacket pointer to pixel data
- write to a blob and use Blob::data() to get pixel data
3. do memcpy to my pixel buffer (10 bit Red, Green, Blue) or assign individual pixel color from PixelPacket to my pixel buffer.
The end result looks strange.
The colors do not match the original image. I did not do any color change.
It's not just because Red and Blue swapped. Seems like there is a lot of Mozaic effects.

Celios

Re: Magick++ : How to get 10 bit raw data from 16 bit TIFF

Posted: 2007-10-05T18:30:28-07:00
by magick
There will be some color variation going from 16 to 10 bits since 6-bits is lopped off each color component. After you run your program, write the image to disk to a file called image.tif. Next type
  • identify -verbose image.tif
Does it report that the color depth is 10 bits? Are you using a modern version of ImageMagick? The latest release is 6.3.6-1.

Re: Magick++ : How to get 10 bit raw data from 16 bit TIFF

Posted: 2007-10-05T22:32:33-07:00
by celios
I used 6.3.4-Q16.
Just now I updated to 6.3.6-Q16.

The identify command confirmed that color depth is 10 bit.