سؤال

Is there a quick way to convert RGB to LAB in Python3 using D50 sRGB?

Python-Colormath too slow

skimage use D65

هل كانت مفيدة؟

المحلول

For now, the white reference in skimage cannot be passed as a parameter (pull request welcome), but here is a workaround:

from skimage import color
color.colorconv.lab_ref_white = np.array([0.96422, 1.0, 0.82521])
lab = color.rgb2lab(image)

نصائح أخرى

Stefan van der Walt's answer was correct at the time, but for anyone who still has the same question and finds this page: as of scikit-image 0.13 (Dec 2016), skimage.color.rgb2lab takes an illuminant parameter, so you can just write

lab = color.rgb2lab(image, illuminant='D50')

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top