colour.read_image

colour.read_image(path, bit_depth=u'float32')[source]

Reads given image using OpenImageIO.

Parameters:
  • path (unicode) – Image path.
  • bit_depth (unicode, optional) – {‘float32’, ‘uint8’, ‘uint16’, ‘float16’}, Image bit_depth.
Returns:

Image as a ndarray.

Return type:

ndarray

Notes

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

Examples

>>> import os
>>> path = os.path.join('tests', 'resources', 'CMSTestPattern.exr')
>>> image = read_image(path)