Page 1 of 1

log to lin conversion, dpx to tif

Posted: 2010-03-18T07:09:55-07:00
by danielHeen
Hello!

I'm on my third day trying to do a successful conversion from a logarithmic dpx to a linear 16bit tif. I've read this thread without results (viewtopic.php?f=1&t=12627&start=0)

I'm using ImageMagick version 6.5.1 on ubuntu 9.10

With the following command I almost get the result I want, but compared to an image converted using Nuke's Log2Lin node it's a bit bright. I've set the options in the command line to match the node in Nuke.

Code: Select all

convert -set reference-black 95 -set reference-white 685 -depth 16 -colorspace rgb -gamma 0.6 input.dpx output.tif
I had to put all the settings in front of the input file to achieve any similarities at all. I also had to put the

Code: Select all

-gamma 0.6
after

Code: Select all

-colorspace rgb
to avoid convert "prettifying" the result. (does that make any sense? The Nuke-file looks blown out (and should be) and the "prettified" Convert-file doesn't.)

To summarise, With the top command I almost get the same result as with Nuke except for a bit brighter result.

Any help would be greatly appreciated!
Thanks,
-Daniel

Re: log to lin conversion, dpx to tif

Posted: 2010-03-18T07:13:20-07:00
by magick
There are a number of patches to the DPX reader / writer since ImageMagick 6.5.1. The current release is 6.6.0-5. Upgrading may resolve the problem.

Re: log to lin conversion, dpx to tif

Posted: 2010-03-18T07:21:59-07:00
by danielHeen
Hey!

Thanks for the mega quick reply!
I thought that might be an issue and tried compiling 6.6.0 but am having trouble getting it to run properly. Can mention that I tried using a different prefix and program-prefix to avoid collision with the installed version(6.5.1).

Do you have any knowledge on when ubuntu upgrades the imagemagick package?
-Daniel

Re: log to lin conversion, dpx to tif

Posted: 2010-03-18T07:23:41-07:00
by magick
If you post a URL to your image we can convert it for you to determine if recent patches to ImageMagick make a difference.

Re: log to lin conversion, dpx to tif

Posted: 2010-03-18T07:34:24-07:00
by danielHeen
Hello again!

Ok, here's a link to the files. I've added the original dpx (input.dpx) and the two converted ones.

http://stormstudios.no/page/imagemagick/dpx2tif.zip

Thanks again,
-Daniel

Re: log to lin conversion, dpx to tif

Posted: 2010-03-18T08:59:00-07:00
by magick
The latest ImageMagick release returns the same output as your version of ImageMagick. We compared the results:
  • compare -metric rmse nuke_log2lin.tif magick.tif x:
    4142.6 (0.063212)
Notice with a gamma of 0.43 we get a more similar image:
  • convert -set reference-black 95 -set reference-white 685 input.dpx -depth 16 -colorspace rgb -gamma 0.43 output.tif
    compare -metric rmse nuke_log2lin.tif output.tif null:
    676.714 (0.010326)

Re: log to lin conversion, dpx to tif

Posted: 2010-03-18T09:16:55-07:00
by danielHeen
Hey!

Yes, I also got a more visually similar result earlier today fiddling around with the gamma. What do you think is the reason for the need of a different gamma?

-Daniel

Re: log to lin conversion, dpx to tif

Posted: 2010-03-18T09:26:54-07:00
by magick
Perhaps there is a bug in Nuke's Log2Lin :-). We 're not sure how to account for the differences. We used the DPX specification for the log to linear transform. Its possible its not implemented properly. We'll take a closer look at the problem later today.

Re: log to lin conversion, dpx to tif

Posted: 2010-03-18T09:34:52-07:00
by danielHeen
Haha! Let's say that Nuke and Shake have both got it wrong ;D
They produced the exact same result I'm afraid..
Also tested djv_convert which matched the above.

Anyway, thanks for your help!
I must say I'm blown away of how great your support is!
Keep up the good work and please let me know if you figure out anything? I really like imagemagick and use it in a lot of scripts. Would like to use it for this as well.

Thanks again,
-Daniel

Re: log to lin conversion, dpx to tif

Posted: 2010-03-19T19:21:40-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.6.0-8 Beta to fix the problem. Thanks.

Re: log to lin conversion, dpx to tif

Posted: 2010-03-20T00:20:55-07:00
by danielHeen
Great! Thanks!

-Daniel

Re: log to lin conversion, dpx to tif

Posted: 2010-03-22T10:33:37-07:00
by danielHeen
Hey!

Checked out 6.6.0-8 and it works like a charm! Thanks a million!

-Daniel