Welcome, Guest
Username: Password: Remember me
Valuable feedback is priceless. Plus, you can get some extra Render Points :)

TOPIC: OpenEXR multi-layer splitting

OpenEXR multi-layer splitting 4 years 1 month ago #26

  • Posts:15 Thank you received: 5
  • shibata's Avatar
  • shibata
  • New RayPumper
  • Karma: 1
Pro jobs are nice and support any output format you choose. However, if you like rendering different layers to separate files, you will have to schedule many jobs or use some script to change the output.

Using an OpenEXR file is a good option, since it supports multiple layers. However, most programs support only a 3 or 4 channel EXR and fail to open a multi-layer.

The user Stefanama asked for help in the forum about multi-layer EXR output. I tried it locally and couldn't open the file, even though Imagemagick would open a common EXR. The gimp plugin we tried crashed ( I thought the issue was with the layers and googled a program to split the file... Shockingly, I couldn't find any :( Looks like multi-layer EXR isn't very common. In the end, he could get his output with multiple files with the plugin, but I thought it would be amazing to use EXR :D . Furthermore, a single EXR is lighter than many PNG. I decided to grab the python OpenEXR specification and write some code to get the layers split.

Currently, the script can split the layers from and EXR file into multiple RGB/RGBA or single-channel files. The output can be either EXR or PNG. Tested with Blender multi-layer files and it works wonders! The code is well commented in case someone wants to take a look at it ;) . The conversion to PNG uses imagemagick, so adding support for other file formats would be easy (just one or two line changes in the code).

The code uses a thread to split the layers and another to run imagemagick, so only two cores are used and conversion can be a little slow for huge files. I plan to rewrite the code to C++ using multiple threads in the future.


Download the exrsplit file and follow the Have fun! :D
The administrator has disabled public write access.
The following user(s) said Thank You: melon

OpenEXR multi-layer splitting 4 years 1 month ago #27

  • Posts:397 Thank you received: 69
  • blending software ideas
  • melon's Avatar
  • melon
  • PumpOperator
  • Karma: 33
Hey, that should be extremely useful - and not only for Blender/RayPump users. :woohoo:

(I'll have a opportunity to test that soon!)

Thanks for sharing!
The administrator has disabled public write access.

Service maintenance



Forum actions

Users online

We have 181 guests and no members online