Re: How to put 10 bit YUV 422 data into a DPX file?
Posted: 2009-06-24T02:27:15-07:00
My new suggestion is to plow the YUV422 to YUV444 10bit - so I don't have any quality loss. Now the only problem is that the DPX file doesn't store the right color space. The YUV DPX file obviously shows YUV as RGB colors. The BMP I store as well looks fine - showing the right colors! When I use "identify" for the YUV DPX file it says: "Colorspace: RGB". How can I fix this so the YUV DPX file is interpreted in the right way?
Here you can find the YUV DPX file: http://www.yourfilehost.com/media.php?c ... 01_YUV.dpx
And that's the code:
Thanks in advance,
Nicola
Here you can find the YUV DPX file: http://www.yourfilehost.com/media.php?c ... 01_YUV.dpx
And that's the code:
Code: Select all
Magick::Blob cImageBlob( psRgbImage, iRgbArraySize * sizeof( short ) );
Magick::Image cMagickImage( cImageBlob,
Magick::Geometry( cDvsBuffer.getCols(), cDvsBuffer.getRows() )/*, 10*/, "YCbCr" );
cMagickImage.level(
0.0, // black point
1023.0, // white point (for 10bit)
1.0 ); // mid point (1.0 seems to preserve the most unique colors)
cMagickImage.depth( 10 );
cMagickImage.colorSpace( MagickCore::YUVColorspace );
cMagickImage.write( cDestFileName.str() + ".dpx" );
// FOR TESTING: write also a BMP
cMagickImage.write( cDestFileName.str() + ".bmp" );
Nicola