2
$\begingroup$

When I take an EXR image rendered by blender and use imagemagick to convert it into a PNG

convert /var/tmp/blender/easter-eggs/vr360/0007.exr  /tmp/x

the resulting image is rather dark. I have to use the -modulate option like

convert /var/tmp/blender/easter-eggs/vr360/0007.exr -modulate 200  /tmp/x.png

and even then looking at the PNG in gimp doesn't look the same as if I load the .EXR in blender's UV/Image editor.

Why do these two pieces of software disagree on how to interpret the values in the .EXR file, and what workflow should I use to convert .EXR to PNG on the command line?

$\endgroup$
7
  • $\begingroup$ what do you mean by "converting EXR to PNG in blender"? how are you doing it? $\endgroup$
    – m.ardito
    Commented Feb 6, 2017 at 21:18
  • $\begingroup$ I did not actually say that I was converting EXR to PNG in blender. I did say that I loaded the .EXR in blender and looked at it in the UV/image editor. $\endgroup$
    – Mutant Bob
    Commented Feb 6, 2017 at 21:55
  • $\begingroup$ well the question title seems to say that... anyway some example image would better explain, perhaps. Maybe load both exr and png in blender and show them aside? There could also be some default setting both in blender (I guess through opengl) and imagemagick, which could contribute to get a different visual result... I'm just guessing, though. $\endgroup$
    – m.ardito
    Commented Feb 6, 2017 at 22:03
  • 1
    $\begingroup$ EXR is encoded with a linear scale. When you view it in blender you are viewing it through a transform set in the color management section. The default settings will convert the image using a sRBG transform with a 2.2 gamma setting. You must instruct imagemagick to use a gamma conversion. Also, you don't need to use other software to convert the image, load your EXR in blender and save the image from the UV/Image editor into the format you need (F3). Make sure that the "save as render" option is enabled so that the image is saved using the view transform. $\endgroup$
    – user1853
    Commented Feb 7, 2017 at 4:22
  • 3
    $\begingroup$ I'm voting to close this question as off-topic because The question doesn't seem to be about blender but the usage of Imagemagick $\endgroup$
    – user1853
    Commented Feb 7, 2017 at 4:22

1 Answer 1

4
$\begingroup$

The short answer is that EXR holds data. In the case of visual data, it is a convention that the visual RGB data is stored in a linearised format.

When encoded as a linearised format, there is no idea of what transfer function is embedded into the data. This means that the imager has to apply the proper transfer function that covers the proper range of data within the EXR.

If you are using the "Default" rendering view, which is the sRGB EOTF, you can identify the different transfer functions and have ImageMagick convert appropriately with something like:

convert myexr.exr -colorspace RGB -colorspace sRGB mynonlineartiff.tiff

If you are using any transfer function other than the sRGB EOTF, the process would require further effort, and in most cases, ImageMagick would be an unacceptable tool to harness. OpenImageIO and OpenColorIO would be more suitable.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged .