Multi-channel EXR support in command-line
Posted: 2019-06-26T07:59:31-07:00
I'm trying to extract/use specific channels from a multi-channel EXR, in order to save a specific render pass as a PNG.
Similar questions have been asked before, but they all date back 2 or more years.
I frequently use ImageMagick in a 3D animation pipeline to convert EXR files to other, smaller formats. Specifically using Pixar RenderMan to render the final images. These images most often contain multiple channels that are then composited to form the final image. However, they also include a so-called "beauty" pass, which is the combination of these channels/passes.
I have managed to render out EXR files that simple contains the "rgb" and "a" channels and these are converted to PNG without problems. Without the extra channels/passes, though.
Now, RenderMan technically refers to the "beauty" pass' channel as "Ci", and this seems to confuse ImageMagick, though it is RGB. So "Ci.R" etc. I could rename this to "rgb" instead of "Ci", which works, but breaks other tools like RenderMan's denoiser.
From what I can tell it isn't possible to tell ImageMagick to look for the "Ci" pass and use it as normal RGB.
I should note, that trying to open this image in Photoshop also just shows up black, so ImageMagick is not alone. However, Nuke correctly identifies the right channels. I don't know if the OpenEXR format somehow specifies which channels should be used as RGBA by default.
List of channels that should be present in the first sample file:
Some sample images...
16-bit EXR straight from render with all passes: https://www.dropbox.com/s/mx9phk5ihox17 ... e.exr?dl=0
16-bit EXR with no AOVs (saved using Pixar "It" tool): https://www.dropbox.com/s/a7ponb8df62ah ... s.exr?dl=0
16-bit EXR after denoising: https://www.dropbox.com/s/xh6herwpnr9vu ... d.exr?dl=0
8-bit PNG of what it should look like: https://www.dropbox.com/s/t930v6zb7blvh ... s.png?dl=0
Similar questions have been asked before, but they all date back 2 or more years.
I frequently use ImageMagick in a 3D animation pipeline to convert EXR files to other, smaller formats. Specifically using Pixar RenderMan to render the final images. These images most often contain multiple channels that are then composited to form the final image. However, they also include a so-called "beauty" pass, which is the combination of these channels/passes.
I have managed to render out EXR files that simple contains the "rgb" and "a" channels and these are converted to PNG without problems. Without the extra channels/passes, though.
Now, RenderMan technically refers to the "beauty" pass' channel as "Ci", and this seems to confuse ImageMagick, though it is RGB. So "Ci.R" etc. I could rename this to "rgb" instead of "Ci", which works, but breaks other tools like RenderMan's denoiser.
From what I can tell it isn't possible to tell ImageMagick to look for the "Ci" pass and use it as normal RGB.
I should note, that trying to open this image in Photoshop also just shows up black, so ImageMagick is not alone. However, Nuke correctly identifies the right channels. I don't know if the OpenEXR format somehow specifies which channels should be used as RGBA by default.
List of channels that should be present in the first sample file:
Code: Select all
Ci
a
specular_mse
albedo
albedo_var
backward
diffuse
diffuse_mse
forward
mse
normal
normal_var
specular
zfiltered
zfiltered_var
16-bit EXR straight from render with all passes: https://www.dropbox.com/s/mx9phk5ihox17 ... e.exr?dl=0
16-bit EXR with no AOVs (saved using Pixar "It" tool): https://www.dropbox.com/s/a7ponb8df62ah ... s.exr?dl=0
16-bit EXR after denoising: https://www.dropbox.com/s/xh6herwpnr9vu ... d.exr?dl=0
8-bit PNG of what it should look like: https://www.dropbox.com/s/t930v6zb7blvh ... s.png?dl=0
Code: Select all
Version: ImageMagick 7.0.8-49 Q16 x64 2019-06-08 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC HDRI Modules OpenMP(2.0)
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib