tfg.io.exr.read_exr
Stay organized with collections
Save and categorize content based on your preferences.
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-10-28 UTC.
[null,null,["Last updated 2022-10-28 UTC."],[],[],null,["# tfg.io.exr.read_exr\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/io/exr.py#L80-L111) |\n\nOpens an EXR file and copies the requested channels into an ndarray. \n\n tfg.io.exr.read_exr(\n filename, channel_names=None\n )\n\nThe Python OpenEXR wrapper uses a dictionary for the channel header, so the\nordering of the channels in the underlying file is lost. If channel_names is\nnot passed, this function orders the output channels with any present RGBA\nchannels first, followed by the remaining channels in alphabetical order.\nBy convention, RGBA channels are named 'R', 'G', 'B', 'A', so this function\nlooks for those strings.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------|------------------------------------------------------------------------------------|\n| `filename` | The name of the EXR file. |\n| `channel_names` | A list of strings naming the channels to read. If None, all channels will be read. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A numpy array containing the image data, and a list of the corresponding channel names. ||\n\n\u003cbr /\u003e"]]