skimage2.color.rgb2xyz#

skimage2.color.rgb2xyz(rgb, *, channel_axis=-1)[source]#

RGB to XYZ color space conversion.

Parameters:
rgb(…, C=3, …) array_like

The image in RGB format. By default, the final dimension denotes channels.

channel_axisint, optional

This parameter indicates which axis of the array corresponds to channels.

Added in version 0.19: channel_axis was added in 0.19.

Returns:
out(…, C=3, …) ndarray

The image in XYZ format. Same dimensions as input.

Raises:
ValueError

If rgb is not at least 2-D with shape (…, C=3, …).

Notes

The CIE XYZ color space is derived from the CIE RGB color space. Note however that this function converts from sRGB.

References

Examples

>>> from _skimage2 import data
>>> img = data.astronaut()
>>> img_xyz = rgb2xyz(img)