Page 1 of 1

Combine EXR keeping layers information

Posted: 2015-06-26T10:20:41-07:00
by ForgetTheNorm
Hi everybody

First, sorry for my poor english.

I encountered some issues using imagemagick to combine EXR. With PNG or anything else, no problem.
I have 4 images at same size, which should be combined to get a bigger image. Each image represents a part of the bigger image (top left, top right, bottom left and bottom right). Each image contains N layers with information (colors, depth, etc). Theses layers must be combined in the final image.

Each image has this signature :

Code: Select all

$ identify imput_tile_0001.exr
imput_tile_0001.exr EXR 400x225 400x225+0+0 16-bit DirectClass 2.501MB 0.000u 0:00.000
I try simple commands as

Code: Select all

$ convert +append *.exr out.exr
$ montage *.exr -tile 2x2 -geometry +0+0 out.exr
Theses commands returns a totally black image, with the correct size, and with only 1 layer.

How can I do this ?

Regards

Re: Combine EXR keeping layers information

Posted: 2015-06-26T10:55:24-07:00
by fmw42
I am not sure IM handles layers EXR images. From convert -list format, I see that it does not support layers as best as I can tell, since it shows - and not +

Code: Select all

EXR  EXR       rw-   High Dynamic-range (HDR)

* native blob support
r read support
w write support
+ support for multiple images  << I think this means layers or frames or pages

But the current IM 6 syntax is to put the input image(s) right after the convert, so

Code: Select all

convert *.exr +append out.exr
IM is often forgiving and this may not help.

You will have to hear from the developers about layered EXR images.

Re: Combine EXR keeping layers information

Posted: 2015-06-26T11:04:59-07:00
by fmw42
Can you convert a layered EXR to some other layered format such as TIFF, just to see if IM preserves the layers?

Re: Combine EXR keeping layers information

Posted: 2015-06-26T11:28:59-07:00
by ForgetTheNorm
Thanks for your replies.

A simple convert IM call from EXR to TIFF generates a complete black TIFF with only one layer.
The source images comes from Blender, it can generate a lot of formats. The generation of a TIFF returns a one-layer image.

Regards

Re: Combine EXR keeping layers information

Posted: 2015-06-26T11:39:40-07:00
by fmw42
Probably means that IM does not support layered EXR images or there is a bug. The IM developers would have to comment.

Try separating one layered EXR image into separate image one for each layer. Then try recombining them as a layered EXR images. Does that work as a test if IM supports layered EXR.

If that works, then try separating each layer of all your images, append them, then recombine each appended layer into a new layered EXR.

Can you convert from a layered tiff to a layered EXR?

What is your IM version and platform? Always provide that!

Re: Combine EXR keeping layers information

Posted: 2015-06-26T11:44:05-07:00
by magick
Post a URL to your EXR image. We'll need to inspect it before we can comment further.

Re: Combine EXR keeping layers information

Posted: 2015-06-26T14:17:24-07:00
by ForgetTheNorm
Hi

The 4 EXR tiles can be found here :
https://www.dropbox.com/sh/p6h8kh5wlroy ... wk_ea?dl=0
(This is the "imput_tile...exr").

The imagemagick version is 6.8.9.9-5.

I found a python script using OpenEXR library for separate layers, but none to create a new Multilayered EXR...

Pierre

Re: Combine EXR keeping layers information

Posted: 2015-06-26T14:33:14-07:00
by fmw42
Magick: See 2.2 release of OpenEXR and documentation at http://www.openexr.com/ReadingAndWritingImageFiles.pdf and http://www.openexr.com/

Re: Combine EXR keeping layers information

Posted: 2015-06-27T06:42:42-07:00
by magick
ImageMagick uses the RGBA-only interface for scan line based files to the OpenEXR delegate library, see http://www.openexr.com/ReadingAndWritingImageFiles.pdf. Any limitations this interface imposes on EXR files are inherited by ImageMagick. We did try some of the tools that are distributed with the OpenEXR delegate library, and they do show your images as all black.

Re: Combine EXR keeping layers information

Posted: 2015-06-27T07:22:31-07:00
by ForgetTheNorm
magick wrote:We did try some of the tools that are distributed with the OpenEXR delegate library, and they do show your images as all black.
2 softwares opened it without any issue :
- Krita shows every layers http://www.pasteall.org/pic/show.php?id=89920
- Blender shows every "main" layers ; when I select one layer, I can select a "sub-layer" http://www.pasteall.org/pic/show.php?id=89919

How did you opened theses files ? I'm on Ubuntu 14 here.

Re: Combine EXR keeping layers information

Posted: 2019-08-01T02:51:12-07:00
by jan.majlath
Any update in this topic ?
I would like to join (one image next to another) two EXR Multilayer images - and preserve layers (both images have the same layers).
For example, I have two images 300 pixels x 300 pixels. After joining I would like to have image 600 pixels x 300 pixels, and the same layers that original images have.
Is it possible to do this with Imagemagick ?

Re: Combine EXR keeping layers information

Posted: 2019-08-01T03:18:45-07:00
by snibgo
magick -list format |grep EXR
EXR EXR rw- High Dynamic-range (HDR)
So the version of IM that I use (v7.0.7-28) can read and write EXR, but does not support multiple images in the EXR.

Re: Combine EXR keeping layers information

Posted: 2019-08-01T09:23:47-07:00
by jan.majlath
Yes, Imagemagick support EXR files and it is possible to append images (vertically and also horizontally), but I need append multilayer EXR files. When I try to append multilayer exr files, output is completely black image and layers "gone away".