Convert DPX YUV 4:2:2 to TGA RGB

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?".
Post Reply
fournij

Convert DPX YUV 4:2:2 to TGA RGB

Post by fournij »

Hello

I want to convert my DPX 10 bit YUV 4:2:2 (cineon big endian) files to TGA (RGB) 8 bit files.

I suppose I have to use the command line program convert.exe, but I don't know which settings to apply.

So when I open the original DPX 10 bit YUV 4:2:2 using imagemagick display.exe program, the image isn't displayed properly, so I think it's a color space issue.

When I use the following command line : convert.exe source.dxp destination.tga the output file is not converted properly; again, it seems to be a color space issue.

Here is the link to the file that I wish to convert (right click and save as...)

http://www.mtlstream.com/DPX_10bits_YUV ... endian.dpx

The file was created using the capture tool within a DVS Clipster and the source was an HDCAM SR tape (1080 59.94i 4:2:2).

thanks
fournij

Re: Convert DPX YUV 4:2:2 to TGA RGB

Post by fournij »

More over, I want to use Magick++ to convert it to TGA RGB

The source code should look like this, but I don't know what fonction to use :

//Need fonction to set the color space to YUV

img.read("source_422.dpx");

//Need something there to change the color space to RGB

img.write("destination_RGB.tga");





Thanks
fournij

Re: Convert DPX YUV 4:2:2 to TGA RGB

Post by fournij »

I read the header of my DPX file :

http://www.mtlstream.com/DPX_10bits_YUV ... endian.dpx

The information in the header _GenericImageHeader._ImageElement[0].Descriptor = 100, that's mean "CbYCrY"

So I try this code to put it to RGB colorspace, Without succes :

Code: Select all

img.read("C:\\DPX_10bits_YUV422_cineon_big_endian.dpx")
img.colorSpace(RGBColorspace);
img.write("C:\\result.tga");

ImageMagick doesn't seems to detect that the input is a CbYBrY (YUV) and it doesn't change the colorspace. Maybe ImageMagick read my DPX file as RGB without using the information in the header.

Is someone can help my about that ?

Should I post this as a bug ?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Convert DPX YUV 4:2:2 to TGA RGB

Post by magick »

It looks like a bug. We'll have a fix for the problem in the ImageMagick Subversion trunk by sometime tomorrow. Thanks.
fournij

Re: Convert DPX YUV 4:2:2 to TGA RGB

Post by fournij »

Thanks

the fix will be probably on the next version ? maybe ImageMagick-6.4.7 for Windows ???

I'm currently using ImageMagick-6.3.7-Q16

Is my code is ok ? :

Code: Select all

img.read("C:\\DPX_10bits_YUV422_cineon_big_endian.dpx")
img.colorSpace(RGBColorspace);

//some other operations like annotate, composite

img.write("C:\\result.tga");

Thanks again
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Convert DPX YUV 4:2:2 to TGA RGB

Post by magick »

Your code looks ok. The patch should be available sometime this weekend in the next point release, ImageMagick 6.4.6-4.
fournij

Re: Convert DPX YUV 4:2:2 to TGA RGB

Post by fournij »

Hi

the new version "ImageMagick-6.4.6-4-Q16-windows-dll.exe" solves the problem with the colorspace, but compared to the version "ImageMagick-6.3.5-8-Q16-windows-dll.exe" I can't extract the time code from the DPX file using the code :

Code: Select all

string tc;
tc = img.attribute("dpx:television.time.code");
I'm gonna post a topic about this bugg.

thanks
Post Reply