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 / xyz2lab

function

skimage.color.colorconv:xyz2lab

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

Signature

def xyz2lab(xyz, illuminant = D65, observer = 2, *, channel_axis = -1)

Summary

XYZ to CIE-LAB color space conversion.

Parameters

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

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

illuminant : {"A", "B", "C", "D50", "D55", "D65", "D75", "E"}, optional

The name of the illuminant (the function is NOT case sensitive).

observer : {"2", "10", "R"}, optional

One of: 2-degree observer, 10-degree observer, or 'R' observer as in R function grDevicesconvertColor.

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. Same dimensions as input.

Raises

: ValueError

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

: ValueError

If either the illuminant or the observer angle is unsupported or unknown.

Notes

By default Observer="2", Illuminant="D65". CIE XYZ tristimulus values x_ref=95.047, y_ref=100., z_ref=108.883. See function ~.xyz_tristimulus_values for a list of supported illuminants.

Examples

from skimage import data
from skimage.color import rgb2xyz, xyz2lab
img = data.astronaut()
img_xyz = rgb2xyz(img)
img_lab = xyz2lab(img_xyz)
✓

Aliases

  • skimage.color.xyz2lab