This is a development version (0.26.1rc0.dev0) and may be unstable.Go to latest (0.26.1rc0.dev0+git20260530.b607368ff)
{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0 / skimage / color / colorconv / lch2lab

function

skimage.color.colorconv:lch2lab

source: /_skimage2/color/colorconv.py:1881

Signature

def lch2lab(lch, *, channel_axis = -1)

Summary

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

Extended Summary

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

Parameters

lch : array_like of shape (..., C=3, ...)

The input image in CIE-LCh color space. Unless channel_axis is set, the final dimension denotes the CIE-LAB channels. The L* values range from 0 to 100; the C values range from 0 to 100; the h values range from 0 to 2*pi.

channel_axis : int, optional

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

Returns

out : ndarray of shape (..., C=3, ...)

The image in CIE-LAB format, of same shape as input.

Raises

: ValueError

If lch does not have at least 3 channels (i.e., L*, C, and h).

Notes

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

Examples

from skimage import data
from skimage.color import rgb2lab, lch2lab, lab2lch
img = data.astronaut()
img_lab = rgb2lab(img)
img_lch = lab2lch(img_lab)
img_lab2 = lch2lab(img_lch)
✓

See also

lab2lch

Aliases

  • skimage.color.lch2lab