Converting DPX to sRGB colorspace

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
digobh
Posts: 8
Joined: 2012-08-29T18:19:25-07:00
Authentication code: 67789

Converting DPX to sRGB colorspace

Post by digobh »

Hi

I'd like to convert a dpx to a jpg but getting a result as close as nuke does.
I am using the command below. Close, but not the same colors though. Heaps of variations happening.

Code: Select all

convert -colorspace sRGB input_filename.dpx -set colorspace sRGB -level 0.74%,58%,0.74 -quality 100% output_filename.jpg
The -level option is to apply a SRGB look up into my jpg, as ImageMagick doesn't seem to do by default.
I am on Linux(ubuntu 12.01) and I've tried using -profile sRGB.icc but I get the error below:

convert: unable to open image `sRGB.icc': @ error/blob.c/OpenBlob/2587.
convert: unable to open file `sRGB.icc': @ error/blob.c/FileToBlob/925.

Using Only the command bellow, wihtout the -level option leaves my jpg with a different lookup. The jpg looks washed out.

Code: Select all

convert -colorspace sRGB input_filename.dpx -set colorspace sRGB -quality 100% output_filename.jpg
Does any one know ho to get he look up looking correct? I just want to get my jpeg from ImageMagick looking the same as my jpeg from nuke. In Nuke I load my file as Cineon(dpx) and Save as SRGB(jpg). And they look exacly the same.

thank you very much for your attention

Rodrigo Guimaraes
digobh
Posts: 8
Joined: 2012-08-29T18:19:25-07:00
Authentication code: 67789

Re: Converting DPX to sRGB colorspace

Post by digobh »

Hi folks,

I sort of found a solution to my problem baking a lut to the file. Now my conversion looks very much like Nuke.
This is using the Hald Clut from Imagemagick. I am not sure if this is the right approach, however, from all alternatives that I found through the forums, that's the best for me that matches nuke color lookups.

Creating a Hald File for color lookups.

For more info go to the source, under: Hald 3D Color Lookup Tables http://www.imagemagick.org/Usage/color_mods/
The command below will create a raw Hald File for you.

Code: Select all

convert   hald:8    hald_8.png
You would use at least a level 8 Hald (the default), which will hold a color cube with 256 colors per side, or 16777216 colors, and produce an image that is 512x512 pixels in size. Such a "hald:" image has every possible 24 bit color possible (3 channels at 8 bit color depth), and saves into an approximately 10Kbyte PNG image.

Now what I did was to bring the had_8.png to nuke, reading as cineon colorspace ans saving it as sRGB colorspace. Then I saved to hald_8_cineon_to_sRGB_nk.png. now this file contains the color difference from hald_8.png

Code: Select all

convert input_file.dpx hald_8_cineon_to_sRGB_nk.png -hald-clut output_file.jpg
The hald image above (hald_8_cineon_to_sRGB_nk.png) is the file hald_8.png read as Cineon and saved out as sRGB in nuke. That bakes out the colorspace change to the hald file.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Converting DPX to sRGB colorspace

Post by anthony »

digobh wrote:The -level option is to apply a SRGB look up into my jpg, as ImageMagick doesn't seem to do by default.
Actually -level doesn't have anything to do with colorspace. Level modifies values as they currently exist.
Also -set colorspace does not modify the values, just change the colorspace setting without converting values.

As such the two have no effect on each other at all! On the other hand using -colorspace sRGB will convert the values and thus effect the results of -level.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
digobh
Posts: 8
Joined: 2012-08-29T18:19:25-07:00
Authentication code: 67789

Re: Converting DPX to sRGB colorspace

Post by digobh »

Hi Anthony,

Thanks for the Clarification. I've noticed that with -set corlospace SRGB, I always got nothig.
Although, using -colorspace sRGB I always get an washed out Image. Maybe coz it's not applying a sRGB LUT on it?

Code: Select all

convert input.dpx -colorspace sRGB output.jpg
Cheers

Rodrigo Guimaraes
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting DPX to sRGB colorspace

Post by fmw42 »

what version of IM are you using. Before IM 6.7.6.7 -colorspace RGB was sRGB and -colorspace sRGB was RGB.
see
viewtopic.php?f=4&t=21269
digobh
Posts: 8
Joined: 2012-08-29T18:19:25-07:00
Authentication code: 67789

Re: Converting DPX to sRGB colorspace

Post by digobh »

Hi

I am using,

Version: ImageMagick 6.6.9-7 2012-04-30 Q16

I've tied the different command below based on the link you sent me:
It gives me a extremely washed out jpg.

convert input.dpx -colorspace rgb -colorspace sRGB output.jpg

Thanks for your attention

PS: My DPX is in Cineon Color Space, Log.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting DPX to sRGB colorspace

Post by fmw42 »

Your version of IM was before the sRGB vs RGB switch. Thus you do not need to add -set colorspace RGB.

I do not know if you will ever get as close as Nuke.
PS: My DPX is in Cineon Color Space, Log.
That is why your -colorspace sRGB changes your image. But so will -colorspace RGB. You are converting from LOG colorspace, it would appear to either RGB (by -colorspace sRGB) or sRGB (by -colorspace RGB). To convert properly, you may have to use profiles. See if your image has a profile (icc or icm) by identify -verbose yourimage.dpx

I do not know if JPG supports LOG colorspace.

I think you will need to post a link to your file so that the IM developers and others can test with it.

How are you viewing your original and your converted files? Perhaps it is a viewer issue. Perhaps the viewer cannot handle LOG colorspace?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Converting DPX to sRGB colorspace

Post by anthony »

two -colorspace operations following each other just adds extra conversions for no gain (unless testing conversion round trips).

Note -colorspace it is not the -profile operator. I always thought -profile was silly in having both its set and convert in the same option! It should also give a warning if you try to convert and no profile is set in the image.

Sorry ranting.. back to the problem at hand.

As for the washed out look. I believe DPX should be using a 'LOG' colorspace by default. If it isn't then that may be a bug. I am not certain as I don't actually use it.

If it is a LOG colorspace and it was not set properly try this

Code: Select all

  convert input.dpx -set colorspace log -colorspace RGB output.png
That assumes the older version of IM otherwise use sRGB for newer versions.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply