Hi Juan

About a and b, to be honest they should be in the range -100, 100 as that's I think how they were defined by CIE. But I will check.
I think you are rigth about L, though, that's clearly a slip on my part, odd since in the first notebook it is obvious that the output of L is in the range of 0-100.
:)
A good test would be to convert a single  colour, say red, from RGB to LAB, 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.

About the swapaxes, are you sure? In the first notebook I use np.swapaxes(rgb_sp,1,2) which seems to work.
`In [4]:`
```rgb_sp=np.array(zip(rsp, gsp ,bsp))
rgb_sp.shape # check the shape of the output array
```
Out[4]:
```(256, 3, 256)
```
In [5]:
```rgb_spectral=np.swapaxes(rgb_sp,1,2)
rgb_spectral.shape # check the shape of the array again
```
Out[5]:
```(256, 256, 3)
```

BUt again, I will check at home and confirm back.

Having ranges clearly in the documentation would be great, thanks for that.
Other than that, I think scikit-image is awesome, I'm using a number of the image morphology functions and they're great to work with.

Cheers,
Matteo

On Tuesday, September 30, 2014 11:15:57 PM UTC-6, Juan Nunez-Iglesias wrote:
Hey Matteo,

I’m not familiar with all the different colour spaces, but from your second notebook you know that L in Lab ranges from 0-100, so I imagine it’s the same in Lch. Similarly for ab -> c. You might want to try 0-100 as your ranges. Various resources on the internet also point to that range, e.g., http://www.colourphil.co.uk/lab_lch_colour_space.shtml .

In addition, I think your call to swapaxes to get lch256 in the final notebook might be incorrect. You need to put axis 0, the channels, at the end for our colour conversions to work, so it should be swapaxes(arr, 0, 2).

Having said that, you are right that our documentation could be improved, at the very least linking to relevant web documents for each function. I’ll add an issue for this.

I hope this helps, and thanks for reporting the issue!

Juan.

Sent from Mailbox

On Wed, Oct 1, 2014 at 2:29 PM, Matteo wrote:

A while ago I wrote a post on my blog with code on how to import in Python a colour palette in an ASCII file and convert it to a Matplotlib colormap:
mycarta.wordpress.com/2014/04/25/convert-color-palettes-to-python-matplotlib-colormaps/

Following that post I wrote a tutorial on a geoscience magazine on how to evaluate and compare colormaps using Python:
wiki.seg.org/wiki/How_to_evaluate_and_compare_color_maps

In the accompanying notebook I show how to convert a 256x3 RGB colormap to a 256x256x3 RGB image, then convert it to CIELAB using scikit-image's rgb2lab, then plot the 256x1 lightness (L) array to evaluate the colormaps perceptually.
You can read the relevant extract of the notebook using this nbviewer link:
http://nbviewer.ipython.org/urls/dl.dropbox.com/s/54zoax2qesb71wn/evaluate_colormaps_skimage_test.ipynb?dl=0
In that case scikit-image worked really well for me.

Now I am trying to follow up with a new tutorial and I run into problems with the color space conversions.
You can follow what I am trying to do in this other notebook extract:
http://nbviewer.ipython.org/urls/dl.dropbox.com/s/noli66nzrlk0676/make_colormap_skimage_test.ipynb?dl=0

The goal of this new tutorial is to show how to build colormaps from scratch using perceptual principles. I design a color palette in LCH (polar version of CIELAB) by keeping Chroma and Lightness fixed and interpolating Hue around the circle, then convert to LAB, then to RGB.
As far as I know the code I wrote should work, but the result is a black colormap. I am thinking I got wrong one or more of the ranges for the LCH coordinates. I assumed L between (0,1), Ch between (0,1), and H between (0, 2*pi).
Is that wrong, and if that's the case, what are the ranges? Many of them are not stated clearly in the documentation in here: http://scikit-image.org/docs/dev/api/skimage.color.html

Is it possible to update the documentation to clearly state all ranges for all colour spaces.