log to lin conversion, dpx to tif

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
User avatar
danielHeen
Posts: 28
Joined: 2010-03-18T06:34:34-07:00
Authentication code: 8675308
Location: Oslo, Norway

log to lin conversion, dpx to tif

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: log to lin conversion, dpx to tif

Post 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.
User avatar
danielHeen
Posts: 28
Joined: 2010-03-18T06:34:34-07:00
Authentication code: 8675308
Location: Oslo, Norway

Re: log to lin conversion, dpx to tif

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: log to lin conversion, dpx to tif

Post 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.
User avatar
danielHeen
Posts: 28
Joined: 2010-03-18T06:34:34-07:00
Authentication code: 8675308
Location: Oslo, Norway

Re: log to lin conversion, dpx to tif

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: log to lin conversion, dpx to tif

Post 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)
User avatar
danielHeen
Posts: 28
Joined: 2010-03-18T06:34:34-07:00
Authentication code: 8675308
Location: Oslo, Norway

Re: log to lin conversion, dpx to tif

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: log to lin conversion, dpx to tif

Post 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.
User avatar
danielHeen
Posts: 28
Joined: 2010-03-18T06:34:34-07:00
Authentication code: 8675308
Location: Oslo, Norway

Re: log to lin conversion, dpx to tif

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: log to lin conversion, dpx to tif

Post 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.
User avatar
danielHeen
Posts: 28
Joined: 2010-03-18T06:34:34-07:00
Authentication code: 8675308
Location: Oslo, Norway

Re: log to lin conversion, dpx to tif

Post by danielHeen »

Great! Thanks!

-Daniel
User avatar
danielHeen
Posts: 28
Joined: 2010-03-18T06:34:34-07:00
Authentication code: 8675308
Location: Oslo, Norway

Re: log to lin conversion, dpx to tif

Post by danielHeen »

Hey!

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

-Daniel
Post Reply