Hi Michael,

Yes, it’s common in Python and you should generally work in floating point 
until the very final step of processing. This will help avoid accumulation of 
rounding errors.

See our documentation on this here:
http://scikit-image.org/docs/dev/user_guide/data_types.html

Happy coding!

Juan.

On 27 Mar 2017, 10:46 AM -0400, Michael O'Brien <mob....@gmail.com>, wrote:
> Using http://www.easyrgb.com/index.php
>
> CIE-L*ab   =   48.000  -14.000   25.000
>
> equals
>
> RGB 0-255  =   105.30   119.53    70.87
> RGB 0-0.1  =  0.41293  0.46875  0.27791
>
> XYZ        =   13.654   16.794    8.461
>
> Illuminant =  D65
> Observer   =  2° (1931)
>
> So Ryan was correct to say the values are scaled between 0 and 1 (I was using 
> the wrong row in my re-conversion to 0 to 255 scale)
> This is the 1st time I've come across RGB scaled to 0 and 1. Is its common in 
> python and does the other scikit-image functions handle the 0 -1 scaled 
> values or should I work with 0 to 255 values to be safe?
>
>
>
>
> > On Mon, 27 Mar 2017 at 14:36 Michael O'Brien <mob....@gmail.com> wrote:
> > > I'm not sure what illuminant colormine uses but if you multiple by 255 
> > > you get 151,154,141 which it getting closer to what I expect (greenish 
> > > colour) with 105,119,70 still being much closer
> > >
> > > On Mon, 27 Mar 2017, 14:22 Ryan Anderson, <rander...@resonon.com> wrote:
> > > > It looks to me as if lab2rgb is returning colors scaled as floats 
> > > > between 0 and 1 while colormine.org is returning 8 bit integers scaled 
> > > > 0-255.
> > > >
> > > > Try multiplying by 255 and comparing the outputs.
> > > >
> > > > On Mar 27, 2017 7:02 AM, "Michael O'Brien" <mob....@gmail.com> wrote:
> > > > >
> > > > >
> > > > > Hi all,
> > > > >
> > > > >
> > > > > If I use the following array of LAB values
> > > > > array([[[ 48.07851346, -14.69400135, 25.2170507 ],
> > > > > [ 63.21232753, -3.65444198, 6.67734193],
> > > > > [ 45.80027308, -2.47952304, 11.5073341 ],
> > > > > [ 46.84900559, -10.37025167, 19.92527996],
> > > > > [ 44.92476952, 19.36861848, 2.97238555],
> > > > > [ 35.50132805, 5.89086564, 1.95259827]]])
> > > > > and use the following code to pass the array to lab2rgb
> > > > > rgbcolours =color.lab2rgb(ClusterColours.values[np.newaxis])
> > > > > I get the array
> > > > > array([[[ 0.40929448, 0.47071505, 0.27701891],
> > > > > [ 0.59383913, 0.60611158, 0.55329837],
> > > > > [ 0.4393785 , 0.4276561 , 0.34999225],
> > > > > [ 0.4159481 , 0.4516056 , 0.3026519 ],
> > > > > [ 0.54449997, 0.36963636, 0.4001209 ],
> > > > > [ 0.36970012, 0.3145826 , 0.315974 ]]])
> > > > > but on colormine.org if I enter the 1st of the LAB values I get 
> > > > > 105,119,70 for RGB and not colours so close to black
> > > > >
> > > > > Where am I going wrong?
> > > > >
> > > > > _______________________________________________
> > > > > scikit-image mailing list
> > > > > scikit-image@python.org
> > > > > https://mail.python.org/mailman/listinfo/scikit-image
> > > > >
> _______________________________________________
> scikit-image mailing list
> scikit-image@python.org
> https://mail.python.org/mailman/listinfo/scikit-image
_______________________________________________
scikit-image mailing list
scikit-image@python.org
https://mail.python.org/mailman/listinfo/scikit-image

Reply via email to