skimage2.color.lab2lch#

skimage2.color.lab2lch(lab, *, channel_axis=-1)[source]#

Convert image in CIE-LAB to CIE-LCh color space.

CIE-LCh is the cylindrical representation of the CIE-LAB (Cartesian) color space.

Parameters:
labarray_like of shape (…, C=3, …)

The input image in CIE-LAB color space. Unless channel_axis is set, the final dimension denotes the CIE-LAB channels. The L* values range from 0 to 100; the a* and b* values range from -128 to 127.

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:
outndarray of shape (…, C=3, …)

The image in CIE-LCh color space, of same shape as input.

Raises:
ValueError

If lab does not have at least 3 channels (i.e., L*, a*, and b*).

See also

lch2lab

Notes

The h channel (i.e., hue) is expressed as an angle in range (0, 2*pi).

References

Examples

>>> from _skimage2 import data
>>> from _skimage2.color import rgb2lab, lab2lch
>>> img = data.astronaut()
>>> img_lab = rgb2lab(img)
>>> img_lch = lab2lch(img_lab)