<p>I don't know any IDE-based tools that do this but a quick Python script should do the trick. I usually use Thijs Vogels' <a href="https://github.com/tvogels/pyexr" rel="nofollow noreferrer">PyEXR</a> to read the multi-channel EXR. Assuming your depth channel is called <code>distance</code> (which needs to be specified in your Mitsuba XML file under your <code>hdrfilm</code>), you can visualize it with the following code:</p>

<pre><code>import pyexr

fp = pyexr.open('multichannel.exr')
img = fp.get('distance')
pyexr.write('distance.exr', img)
</code></pre>

CC BY-SA 4.0
2020-02-18T04:11:50.787Z
2020-02-18T04:11:50.787Z
Hubble
<p>I am relatively new to computer vision and image processing. I have a single EXR file with 7 channels: 1-3 give me the RGB values, 4-6 give me the surface normals coded as RGB values and 7th channel contains depth information from the camera of the rendered image. I obtained this from the mitsuba renderer using the multi-channel plug-in. </p>

<p>I was wondering if there was any way to view these 7 channels separately. For eg. I would like an image showing only the depth values in grayscale. So far I haven't found a multi-channel EXR file viewer that does this for me. An example of what I'm talking about is shown in the link: <a href="https://www.mitsuba-renderer.org/devblog/wp-content/uploads/2014/02/multichannel.jpg" rel="nofollow noreferrer">https://www.mitsuba-renderer.org/devblog/wp-content/uploads/2014/02/multichannel.jpg</a></p>

<p>Really looking forward to any help. Thanks!!</p>

<rendering><image-processing>
Extracting information from EXR Files
Roshan Thomas Eapen
# Extracting information from EXR Files

(Asked by: username_0 on 2020-02-17)

I am relatively new to computer vision and image processing. I have a single EXR file with 7 channels: 1-3 give me the RGB values, 4-6 give me the surface normals coded as RGB values and 7th channel contains depth information from the camera of the rendered image. I obtained this from the mitsuba renderer using the multi-channel plug-in.

I was wondering if there was any way to view these 7 channels separately. For eg. I would like an image showing only the depth values in grayscale. So far I haven't found a multi-channel EXR file viewer that does this for me. An example of what I'm talking about is shown in the link: <https://www.mitsuba-renderer.org/devblog/wp-content/uploads/2014/02/multichannel.jpg>

Really looking forward to any help. Thanks!!

**Tags:** rendering, image-processing


---

## 1 answers

### Answer by username_1 on 2020-02-18. Score: 1

I don't know any IDE-based tools that do this but a quick Python script should do the trick. I usually use Thijs Vogels' [PyEXR](https://github.com/tvogels/pyexr) to read the multi-channel EXR. Assuming your depth channel is called `distance` (which needs to be specified in your Mitsuba XML file under your `hdrfilm`), you can visualize it with the following code:

```
import pyexr

fp = pyexr.open('multichannel.exr')
img = fp.get('distance')
pyexr.write('distance.exr', img)

```


---

