How to export a channel from multi-channel EXR image using OpenEXR

507 Views Asked by At

I have EXR image containing the multiple image channels like cryptomatte, reflect, refract, specular and etc. I would like to go ahead and export these embedded channels as separate PNG or JPG images. Both OpenEXR and OpenEXR Python module are installed, the EXR file can be read from inside of Python:

import OpenEXR
file = OpenEXR.InputFile('/home/my-exr-image.exr')
dw = file.header()['dataWindow']
sz = (dw.max.x - dw.min.x + 1, dw.max.y - dw.min.y + 1)

What commands should be used to export the reflect channel as a separate PNG image?

0

There are 0 best solutions below