colour.io.read_image_OpenImageIO

colour.io.read_image_OpenImageIO(path, bit_depth='float32', attributes=False)[source]

Reads the image at given path using OpenImageIO.

Parameters:
  • path (unicode) – Image path.
  • bit_depth (unicode, optional) – {‘float32’, ‘uint8’, ‘uint16’, ‘float16’}, 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, optional) – Whether to return the image attributes.
Returns:

Image as a ndarray or tuple of image as ndarray and list of attributes

Return type:

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(path)  # doctest: +SKIP