Google I/O returns May 18-20! Reserve space and build your schedule Register now

tfg.io.exr.read_exr

Opens an EXR file and copies the requested channels into an ndarray.

The Python OpenEXR wrapper uses a dictionary for the channel header, so the ordering of the channels in the underlying file is lost. If channel_names is not passed, this function orders the output channels with any present RGBA channels first, followed by the remaining channels in alphabetical order. By convention, RGBA channels are named 'R', 'G', 'B', 'A', so this function looks for those strings.

filename The name of the EXR file.
channel_names A list of strings naming the channels to read. If None, all channels will be read.

A numpy array containing the image data, and a list of the corresponding channel names.