moten.colorspace module

Code to convert RGB to other color spaces

moten.colorspace.rgb2lab(image)[source]

Convert RGB to CIE LAB color space in-place

Parameters

image (3D numpy float array) – Array must be in [0,1] range. Last dimension corresponds to RGB channels.

Returns

LAB – The CIE LAB representation in the image.

Return type

3D numpy float array

moten.colorspace.rgb2lch(image)[source]

Convert RGB to CIE LCH color space in-place

Parameters

image (3D numpy float array) – Array must be in [0,1] range. Last dimension corresponds to RGB channels.

Returns

LCH – The CIE LCH representation in the image.

Return type

3D numpy float array

moten.colorspace.rgb2xyz(image)[source]

Convert RGB to CIE XYZ color space in-place

Parameters

image (3D numpy float array) – Array must be in [0,1] range. Last dimension corresponds to RGB channels.

Returns

LAB – The CIE XYZ representation in the image.

Return type

3D numpy float array