Copies channels from an OpenEXR.InputFile into a numpy array.
tfg.io.exr.channels_to_ndarray(
exr, channel_names
)
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.
Args | |
---|---|
exr
|
An OpenEXR.InputFile that is already open. |
channel_names
|
A list of strings naming the channels to read. |
Returns | |
---|---|
A numpy ndarray. |