colour.read_image(path: str | Path, bit_depth: Literal['uint8', 'uint16', 'float16', 'float32', 'float64', 'float128'] = 'float32', method: Literal['Imageio', 'OpenImageIO'] | str = 'OpenImageIO', **kwargs: Any) NDArrayReal[source]#

Read the image data at given path using given method.

  • path (str | Path) – Image path.

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

  • method (Literal['Imageio', 'OpenImageIO'] | str) – Read method, i.e. the image library used for reading images.

  • additional_data – {}, Whether to return additional data.

  • kwargs (Any)


Image data.

Return type:



  • If the given method is OpenImageIO but the library is not available writing will be performed by Imageio.

  • If the given method is Imageio, kwargs is passed directly to the wrapped definition.

  • 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(path)
>>> image.shape  
(1267, 1274, 3)
>>> image.dtype