skimage2.color.rgb2lab#
- skimage2.color.rgb2lab(rgb, illuminant='D65', observer='2', *, channel_axis=-1)[source]#
Conversion from the sRGB color space (IEC 61966-2-1:1999) to the CIE Lab colorspace under the given illuminant and observer.
- Parameters:
- rgbarray_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”}, optional
The name of the illuminant (the function is NOT case sensitive).
- observer{“2”, “10”, “R”}, optional
The aperture angle of the observer.
- channel_axisint, optional
This parameter indicates which axis of the array corresponds to channels.
Added in version 0.19:
channel_axiswas added in 0.19.
- Returns:
- outndarray of shape (…, C=3, …)
The image in Lab format. Same dimensions as input.
- Raises:
- ValueError
If
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.References