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

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

Post by Nicola »

Hi,

I'm using IM with VC++ and want to put some data array into an DPX file.
The data array contains an image of 10 bit YUV 422 sorted:

Code: Select all

|  U  |  Y  |  V  | 00 |  Y  |  U  |  Y  | 00 |...
|10bit|10bit|10bit|2bit|10bit|10bit|10bit|2bit|...
|  32bit = 4Byte       |  32bit = 4Byte       |...
Is there a simple method to get this into an Magick::Image object that than can be written to a DPX file?

For an RGB (actually BGR) image I do it the following way:

Code: Select all

          Magick::Image cMagickImage(
            pcBmpBuffer->getWidth(),
            pcBmpBuffer->getHeight(),
            "BGR",
            Magick::CharPixel,
            pcBmpBuffer->getImage() );
          cMagickImage.write( "test.dpx" );
Very easy but I don't know how to do the same for my 10 bit YUV 422 data...

Thank you in advance,
Nicola
Nicola

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

Post by Nicola »

No suggestions?

My first work around was to convert the data into a "simpler" format of a short array sorted: UY VY UY VY ...
But it is still YUV 422 and I don't know how to convert this appropriately into a Magick::Image...

Do I have to convert it first to YUV 444? But that wouldn't be a perfect solution :?
koshiji

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

Post by koshiji »

I checked source of DPX Coder.
For 10bit YUV 422 data, it seems to support only reading.
Nicola

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

Post by Nicola »

koshiji wrote:I checked source of DPX Coder.
For 10bit YUV 422 data, it seems to support only reading.
Is this true? I would appreciate to get some information about that from someone responsible. Many thanks in advance!

EDIT: Anyway, thank you koshiji!
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 »

Can you post a URL to one or two DPX images that are YUV encoded? We will use them to verify that ImageMagick can write proper YUV-encoded DPX images.
Nicola

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

Post by Nicola »

magick wrote:Can you post a URL to one or two DPX images that are YUV encoded? We will use them to verify that ImageMagick can write proper YUV-encoded DPX images.
Sorry, but I don't have those images. I want to create some from an array I have in VC++!
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 »

DPX supports YCbCr at 422 and at 444. Is that what you need? If DPX supports ,YUV can you point us to a reference so we can investigate. ImageMagick supports YCbCR (e.g. convert myimage -colorspace ycbcr image.dpx) but we will need to get back to you on whether it supports YCbCr at 422. If it doesn't we add support sometime this week,
Nicola

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

Post by Nicola »

OK, let me try to explain again what I have and what I need.

I'm programming in VC++. Having an array of image data (captured from a cam by myself, no stored image exists) I want to place this data into a DPX file. The data is given as 10 Bit YUV 422. This means I have (width x height) Y values and (width x height / 2) U and V values, respectively, all in 10 Bit. Those YUV values I want to store without any conversion!

Till now I tried a lot but didn't get a format so the in the end stored image is displayed all right. Amongst others I put the 10 Bit values into shorts, inserted the shorts array into a Blob, and initialized an image with that Blob. The resulting image shows something that looks like the upper left quarter of the image but in strange colors and not as accurate as it should be, I think.
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 can only store YUV in DPX if the DPX standard permits YUV. We don't have access to the DPX file specification right now. That is why we asked. We do know DPX stores YCbCr but have not heard of it storing YUV. Do you know if the DPX standard supports YUV? If the standard does not support it, you cannot store YUV in DPX without some sort of color conversions (e.g. RGB or YCbCr).
Nicola

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

Post by Nicola »

I don't know if the DPX standard supports YUV.

What would be the way, if I'd say my YUV data is YCbCr? I'm not sure, if it is real YUV.

Or can I load the 10 bit YUV 422 data into a Magick::Image anyway, and convert those data to 10 bit RGB and store this?
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 »

Read your data as a YUV blob. It automatically converts the image to the YCbCr colorspace. Now write the image to a DPX image. If all goes well your DPX image remains in the YCbCr colorspace which we believe is what you want. Use the identify -verbose program to list the attributes of your DPX image to verity its in the YCbCr colorspace.
Nicola

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

Post by Nicola »

And the 422???
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 »

From our earlier message we mentioned we need to investigate support for YCbCr 422. It may be there we just need time to verify.
Nicola

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

Post by Nicola »

magick wrote:From our earlier message we mentioned we need to investigate support for YCbCr 422. It may be there we just need time to verify.
OK, thank you very much. Then good luck with this job ;-)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

Don't know if this will help or perhaps you have seen this, but some information may be available or ordered at references at http://en.wikipedia.org/wiki/Digital_Picture_Exchange

see also

http://www.fileformat.info/format/dpx/egff.htm
http://www.imagemagick.org/script/motion-picture.php
http://www.digitalpreservation.gov/form ... 0178.shtml
Post Reply