bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / color / colorconv / rgb2lab
function
skimage.color.colorconv:rgb2lab
source: /dev/scikit-image/src/skimage/color/colorconv.py:1234
Signature
def rgb2lab(rgb, illuminant = D65, observer = 2, *, channel_axis = -1)Summary
Conversion from the sRGB color space (IEC 61966-2-1:1999) to the CIE Lab colorspace under the given illuminant and observer.
Parameters
rgb: array_like of shape (..., C=3, ...)The image in RGB format. By default, the final dimension denotes channels.
illuminant: {"A", "B", "C", "D50", "D55", "D65", "D75", "E"}, optionalThe name of the illuminant (the function is NOT case sensitive).
observer: {"2", "10", "R"}, optionalThe aperture angle of the observer.
channel_axis: int, optionalThis parameter indicates which axis of the array corresponds to channels.
Returns
out: ndarray of shape (..., C=3, ...)The image in Lab format. Same dimensions as input.
Raises
: ValueErrorIf
rgbis not at least 2-D with shape (..., C=3, ...).
Notes
RGB is a device-dependent color space so, if you use this function, be sure that the image you are analyzing has been mapped to the sRGB color space.
This function uses rgb2xyz and xyz2lab. 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.
Aliases
skimage.color.rgb2lab