How to put 10 bit YUV 422 data into a DPX file?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Nicola

Re: How to put 10 bit YUV 422 data into a DPX file?

Post by Nicola »

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:

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" );
Thanks in advance,
Nicola
Nicola

Re: How to put 10 bit YUV 422 data into a DPX file?

Post by Nicola »

OK, I found that the LogColorspace seems to be the one I need! Is this really the only possible solution?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: How to put 10 bit YUV 422 data into a DPX file?

Post by magick »

You probably want the YCbCr colorspace. We're working on a patch to fully support this colorspace. YCbCR444 should be supported in the next point release and YCbCr422 is being worked on now.
Nicola

Re: How to put 10 bit YUV 422 data into a DPX file?

Post by Nicola »

magick wrote:You probably want the YCbCr colorspace. We're working on a patch to fully support this colorspace. YCbCR444 should be supported in the next point release and YCbCr422 is being worked on now.
Thanks, good to know...
Post Reply