Forum

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 3 years 9 months ago #26


  • Posts:15 Thank you received: 5
  • shibata's Avatar
  • shibata
  • New RayPumper
  • OFFLINE
  • 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 (yorik.uncreated.net/guestblog.php?2011=67). 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 www.blendernation.com/2013/04/30/add-on-...yers-to-image-files/, 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.

Code: github.com/tiagoshibata/exrsplit/tree/python

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

OpenEXR multi-layer splitting 3 years 9 months ago #27


  • Posts:397 Thank you received: 69
  • blending software ideas
  • melon's Avatar
  • melon
  • PumpOperator
  • OFFLINE
  • 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

SERVICE IS OFFLINE

 

Forum actions

Users online

We have 158 guests and no members online