colour.io.as_3_channels_image#

colour.io.as_3_channels_image(a: ArrayLike) NDArrayFloat[source]#

Convert the specified array \(a\) to a 3-channel image-like representation.

Parameters:

a (ArrayLike) – Array \(a\) to convert to a 3-channel image-like representation.

Returns:

3-channel image-like representation of array \(a\).

Return type:

numpy.ndarray

Raises:

ValueError – If the array has more than 3 dimensions or more than 1 or 3 channels.

Examples

>>> as_3_channels_image(0.18)
array([[[ 0.18,  0.18,  0.18]]])
>>> as_3_channels_image([0.18])
array([[[ 0.18,  0.18,  0.18]]])
>>> as_3_channels_image([0.18, 0.18, 0.18])
array([[[ 0.18,  0.18,  0.18]]])
>>> as_3_channels_image([[0.18, 0.18, 0.18]])
array([[[ 0.18,  0.18,  0.18]]])
>>> as_3_channels_image([[[0.18, 0.18, 0.18]]])
array([[[ 0.18,  0.18,  0.18]]])
>>> as_3_channels_image([[[[0.18, 0.18, 0.18]]]])
array([[[ 0.18,  0.18,  0.18]]])