Save the date! Google I/O returns May 18-20 Register now

tfg.io.exr.channels_to_ndarray

Copies channels from an OpenEXR.InputFile into a numpy array.

If the EXR image is of size (width, height), the result will be a numpy array of shape (height, width, len(channel_names)), where the last dimension holds the channels in the order they were specified in channel_names. The requested channels must all have the same datatype.

exr An OpenEXR.InputFile that is already open.
channel_names A list of strings naming the channels to read.

A numpy ndarray.

ValueError If the channels have different datatypes.
RuntimeError If a channel has an unknown type.