In this tutorial, we will see how to save the Render Passes of our renders into an EXR file and then open these very files and modify them in Compositing.



Video Transcript

Hello everyone! In this tutorial, we will see how to save the Render Passes of our renders into an EXR file and then open these very files and modify them in Compositing.

Specifically, in this example, we will see how to retrieve the mask of an object from a rendered image using the IndexOB information channel, to modify some of its characteristics in Compositing.

The tutorial was created using Blender 3.6, but the features described are available at least since version 2.49.

Alright, let's get started! Let's see how to save the Render Passes of our scene into an EXR file.

I opened a Blender project, in which there are several objects, ready for rendering.

I set the output file type for the render to OpenEXR Multilayer, in the Output tab of the Properties Editor. Make sure to select the Multilayer variant of this file format.

Before starting the rendering of the scene, I need to select the Render Passes I want to save to file in the Passes section of the View Layer tab, within the Properties Editor.

In my case, I'm selecting only the Object Index because I want to be able to isolate certain objects based on a numeric identifier I will assign to them shortly.

In the Render Layers node, the IndexOB field will appear, which is how the Object Index Pass is referred to here. Note that there's no need to connect this information in any way to the Composite node.

Now, I'm setting different numeric indices for some objects in the scene, such as the desk, the chair, or the window panes. The numeric indices should be set for each selected object in the Pass Index tab of the Relations section, within the Object tab of the Properties Editor.

Now, I can start the rendering of the scene. Once the rendering is completed, I save it to disk in a file with an EXR extension.

The first part of the job is done: I've saved the desired information channel in the EXR file!

From here on, you can replicate my steps with the EXR file provided in the free package!

Let's then open a new Blender project to see how to modify the appearance of an element from the render saved in the file.

First, let's open a Compositing Nodes window and activate the use of Nodes.

Let's delete the Render Layer node and add, in its place, an Input Image node.

Also, let's add a Viewer node and a Reroute node, connecting them so that the Image output of the Image node goes to the Reroute, and from the Reroute, it goes to both the Composite and Viewer nodes.

This way, we can see a preview of our work in this window.

In the Image node, let's, of course, load the EXR image we saved to the disk in the first part of this tutorial. Alternatively, we can drag and drop the EXR file directly from the disk into the Compositing window.

Let's connect the Combined output of the Image node to the Reroute node.

If the Backdrop option is active, you'll see the image as the background of the window. Press the V key to shrink this preview, or conversely, the ALT + V key combination to enlarge it.

If we drag-and-drop the EXR file in the Compositor Editor, we'll see IndexOB and other channels in the node.

This doesn't happen when we open the EXR file from an Image node.

In that case, if we open the Transform panel of the Image node and click on Node - Properties - Composite, we'll notice that we can change this menu entry to View Layer.

When we do that, a second menu will appear where we can also select IndexOB, indicating that the information has been loaded but isn't yet accessible in the Compositing window.

Let's open an Image editor.

In the Image editor, let's load the EXR image we imported into the project.

The fields saved in the EXR file should now appear in the Image node, within the Compositing window. Don't ask me why, but it seems the image needs to be opened in an Image editor in order to retrieve its components in Compositing.

Great: in this way, we have retrieved the information stored in the OpenEXR Multilayer file, among which, in our case, is the IndexOB field. In the first part of the tutorial, I assigned some numeric values to the Pass Index fields of a couple of objects. To retrieve them, we connect a Converter - ID Mask node between the IndexOB output of the Image node and the Reroute node.

We then adjust the value in the Index field until we identify the desk, which will be shown in white in the Backdrop preview, while the rest of the image will turn black.

We can then extract a mask for some objects to modify them directly on the rendered image. Let's try, for instance, to use a Color Balance node on the desk.

To retrieve the original colors of the desk only, we multiply the mask output from the ID Mask by the Combined output of the Image node.

This can be done using a Color Mix node set to Multiply mode, making sure to connect Combined to the first Image input of Mix and the ID Mask output to the second Image input of Mix.

We can then connect the output of Multiply to a Color Balance node or any other color correction node or other effects, depending on our needs.

To see the editing on the complete image, we also insert a Color - Alpha Over node into the scene.

Next, connect the Combined to the first Image input of this new Alpha Over node and the output of the Color Balance node to the second Image input.

Then connect the Image output of the Alpha Over node to the Reroute node.

The Alpha Over node isn't functioning as it should because its Factor is set to 1 for the entire image, meaning we are only using the second Image input, which is the output from the Color Balance.

To limit the overlap of the second image to just the desk, we need a mask that's black everywhere except for the areas of the desk.

This will be used as the Factor for the Alpha Over node...

… well, that's precisely the mask we're getting from ID Mask!

Let's make this connection and observe the result, possibly continuing to adjust the Color Balance node or any other post-production node, depending on our needs.

We can assess the differences introduced by the Color Balance node by selecting it and repeatedly pressing the M key, which is a shortcut for "Mute", to switch the node on or off.

Using other ID Mask nodes, set with different values for the Index field, we can isolate other image elements to modify them with other node setups.

In this example, I only activated the Object Index before starting the rendering and saving it in the OpenEXR Multilayer file, but obviously, you can save other Passes in the file to achieve different effects.

I hope this tutorial has been helpful! See you soon!

This website is intended solely to showcase some of my work and has no promotional purpose. Please note that I am not currently seeking - nor will I respond to - requests for custom work, consulting services, or any other form of professional collaboration.


EXTENDED PRIVACY AND COOKIE USAGE POLICY