DPX to TIF bug

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
salvati.marc

DPX to TIF bug

Post by salvati.marc »

Hello everyone,
I tried a conversion of a DPX file (Log, 10 bits) to a Tif file.
And my tif file gets darker than the original file.
then I tried to convert first to EXR and then to Tif.
The result Tif file is the same color as expected from the Dpx file.
I suppose some default parameter are used in the DPX to Tif conversion, not used in the DPX to EXR...
Or is it a bug? If someone had the same problem, and found a solution, let me know.

The command i run are really simple:
bad result(darker) in the tif file:

Code: Select all

convert myFile.dpx myFile.tif 
expected result in the tif file:

Code: Select all

convert myFile.dpx myFile.exr
convert myFile.exr myFile.tif
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: DPX to TIF bug

Post by fmw42 »

Perhaps you should post a link to your dpx image so others can test it. Also you did not say what version of IM (and platform) you are using. So if it is old, perhaps an upgrade is in order.
salvati.marc

Re: DPX to TIF bug

Post by salvati.marc »

i m using the most recent version 6.6.4
I have to find a mean to give you a file to chek it.
salvati.marc

Re: DPX to TIF bug

Post by salvati.marc »

Ok i have a way to reproduce the problem.

convert -size 100x100 plasma:fractal -colorspace Log -depth 10 testFractal.dpx
convert testFractal.dpx -depth 16 testFractalWrong.tif
convert testFractal.dpx -depth 16 testFractal.exr
convert testFractal.exr -depth 16 testFractalRight.tif

I would like to know why testFractalWrong.tif and testFractalRight.tif are different...
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: DPX to TIF bug

Post by Drarakel »

salvati.marc wrote:I would like to know why testFractalWrong.tif and testFractalRight.tif are different...
With IM v6.6.4-7 Q16, on Windows XP, I'm getting two identical images with these commands.
What exact IM version and operating system are you using?
salvati.marc

Re: DPX to TIF bug

Post by salvati.marc »

If you have downloaded the binary, then there is no EXR support... so i guess the testFractal.exr is not a exr file.
You have to compile from the source and enable EXR support with openEXR to be able to produce exr files.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: DPX to TIF bug

Post by Drarakel »

Ah, that makes sense! :)
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: DPX to TIF bug

Post by Drarakel »

Can you upload your 'testFractalWrong.tif' and 'testFractalRight.tif' files somewhere? Just curious..
salvati.marc

Re: DPX to TIF bug

Post by salvati.marc »

Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: DPX to TIF bug

Post by Drarakel »

Well, I don't know much about these formats.. But the first conversion to TIFF (testFractalWrong.tif) converts the values to RGB (16bit), while the second one (testFractalRight.tif) probably simply stores the Log values (as RGB).
If you want to recreate that in your DPX->TIFF conversion, so that you can see the Log values for a quick test, then try:
convert testFractal.dpx -depth 16 -set colorspace RGB testFractal2.tif
You should get the same output as with 'testFractalRight.tif'.

(Side note: I'm getting a completely different 'testFractalWrong.tif' than you - but that's probably also due to the different IM versions..)
salvati.marc

Re: DPX to TIF bug

Post by salvati.marc »

Since I dont specify any colorspace in theparameters, I think that both tif should be log like colors. Am i wrong?
changing to 16bit, does not mean changing to linear, does it?
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: DPX to TIF bug

Post by Drarakel »

I don't know much about these special formats and about Log. But sometimes I had similar difficulties when storing different colorspaces.
Regarding your case: Log is a separate colorspace for IM - and TIFF doesn't know that logarithmic RGB space. So, you have the wrong output format.
It could be compared to a conversion from e.g. a CMYK JPG to PNG. PNG can't store CMYK, so ImageMagick has to make an automatic (simple) conversion to RGB first.

And in your case, IM also has to do an automatic conversion to normal RGB when storing the DPX as TIFF. I don't know why it doesn't happen in your DPX->EXR->TIFF conversion. Seems that the EXR format is handled differently and the 'Log' attribute gets lost along the way or something.. So, one could say, 'testFractalRight.tif' is actually the wrong file. :wink:

As I said, if you really want to store the Log values as TIFF, then you have to fool IM by setting the colorspace value to something that is supported by the output file. A round trip from DPX to 16bit TIFF and back to DPX with the Log values:
convert testFractal.dpx -depth 16 -set colorspace RGB testFractal2.tif
convert testFractal2.tif -set colorspace Log -depth 10 testFractal3.tif
Post Reply