colour.io.read_image_OpenImageIO#

colour.io.read_image_OpenImageIO(path: str | Path, bit_depth: Literal['uint8', 'uint16', 'float16', 'float32', 'float64', 'float128'] = 'float32', additional_data: bool = False, **kwargs: Any) NDArrayReal | Tuple[NDArrayReal, list][source]#

Read the image data at given path using OpenImageIO.

Parameters:
  • path (str | Path) – Image path.

  • bit_depth (Literal['uint8', 'uint16', 'float16', 'float32', 'float64', 'float128']) – Returned image bit-depth, the bit-depth conversion behaviour is driven directly by OpenImageIO, this definition only converts to the relevant data type after reading.

  • additional_data (bool) – Whether to return additional data.

  • kwargs (Any)

Returns:

Image data or tuple of image data and list of colour.io.Image_Specification_Attribute class instances.

Return type:

class`numpy.ndarray` or tuple

Notes

  • For convenience, single channel images are squeezed to 2D arrays.

Examples

>>> import os
>>> import colour
>>> path = os.path.join(
...     colour.__path__[0],
...     "io",
...     "tests",
...     "resources",
...     "CMS_Test_Pattern.exr",
... )
>>> image = read_image_OpenImageIO(path)