Opens an EXR file and copies the requested channels into an ndarray.
tfg.io.exr.read_exr(
filename, channel_names=None
)
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.
Args |
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.
|
Returns |
A numpy array containing the image data, and a list of the corresponding
channel names.
|