-
I'm trying to convert from 255 bit colour to the L*a*b* colour space. From reviewing the docs, I see line
Thus my understanding is that the below code should work? a = np.array([103, 103, 103])
a_as_lab = colour.convert(a, 'sRGB', 'CIE Lab')
print(a_as_lab) Yields result
However according to color designer I would expect value Trying to understand what is causing this variance by several orders of magnitude,
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
I did some further testing with different values, it appears I need to do some transformation between Domain-Range-Scales? I did this roughly as below b= np.asarray([113, 167, 138]) / 255.0
b_as_lab = colour.convert(b, 'sRGB', 'CIE Lab') * 100.0 Which yields result
which matches the expected value with my test methodology above: 64.15 -24.21 9.39. (I understand this division and multiplication is definitely not the be best way to do this, seeking a better way) However when I try this same code with the a as above, I get the wrong value
I tested with other low magnitude values such as |
Beta Was this translation helpful? Give feedback.
-
I suspect the problem is related to the fact that the sRGB standard defines the RGB to XYZ matrix to only four decimal places. When using this matrix, converting equal sRGB values to XYZ as a step on the way to L*a*b* will produce XYZ values which are not an exact multiple of D65 white. Thus zero a* and b* values will not be produced. Setting the
|
Beta Was this translation helpful? Give feedback.
-
I have to admit, being a control freak I like to keep manual control of the steps, and not use the combined
|
Beta Was this translation helpful? Give feedback.
I have to admit, being a control freak I like to keep manual control of the steps, and not use the combined
convert()
function. If I do that I get: