Search code examples
python-3.xscikit-imagesrgb

What should be the input to skimage.color.rgb2lab?


I've been using linear rgb (no gamma correction) with rgb2lab. However I just noticed that rgb2lab is really rgb2xyz followed by xyz2lab, and that rgb2xyz actually expects sRGB. So it would seem that if I have an sRGB image with RGB in (0,255) I should pass image/255 to rgb2lab. Is that right?


Solution

  • You can do that no problem, but scikit-image will automatically convert the 0–255 range to 0.0–1.0. See Image data types and what they mean in our documentation for details.