Magick++ : How to get 10 bit raw data from 16 bit TIFF
Posted: 2007-10-05T18:25:54-07:00
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
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