str, bit_depth: Literal['uint8', 'uint16', 'float16', 'float32', 'float64', 'float128'] = 'float32', attributes: bool = False) NDArrayReal | Tuple[NDArrayReal, list][source]#

Read the image data at given path using OpenImageIO.

  • path (str) – 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.

  • attributes (bool) – Whether to return the image attributes.


Image data or tuple of image data and list of class instances.

Return type:

class`numpy.ndarray` or tuple


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


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