Hi Stefan (and Juan)
I run this test last night. Nothing fancy, essentially I created a 16x16x3 RGB azure image (RGB 0,153,255 or 0,0.6,1) and took it for a walk from RGB to LAB to LCH then back to LAB and RGB again. http://nbviewer.ipython.org/urls/dl.dropbox.com/s/44b9udiqz4npp0b/color_spac... Feel free to use this if you like as an example of color conversion. I will be adding it to my GitHub anyway https://github.com/mycarta
As you can see the loop of transformations closes precisely. When I tried with pure red (RGB 1,0,0 or 255,0,0) the final RGB values are all e-16 numbers, some negative. Not sure if that qualifies as deficiencies. Certainly it points to me to the need to include documenntation on the coordinate ranges as Juan observed.
From this I conclude that:
r,g, and b are in the range (0 1) L is in the range (0 100) as Juan pointed out (already evident from my color evaluation notebook), however a and b must be in the range (-100 100) since a is small but positive and b is large but negative (as expected) in my example chrima c must be in the range (0 100) because it is the distance from the polar axis so it can't be negative h is in the range (0 2pi) as specified already in the documentation
I hope this is useful. I'l lbe checking my original example with the new ranges tonigth. Cheers Matteo
On Thursday, October 2, 2014 4:02:54 PM UTC-6, Stefan van der Walt wrote:
A good test would be to convert a single colour, say red, from RGB to
to LCH, then back to LAB and RGB and check the values at each step. I'll try tomorrow and post my results back for your information.
Did you have any luck with that? Also, if you come up with any good test cases that point out deficiencies in the code, we'd be happy to include them in the test suite.
Thanks for the link to the article--it's very enjoyable to learn more about color map perception in such a vividly illustrated way.