Bug in io.ImageCollection

Stéfan van der Walt stefan at sun.ac.za
Wed Oct 21 16:20:00 EDT 2009


Hey Ralf

2009/10/21 Ralf Gommers <ralf.gommers at googlemail.com>:
> Fixed in my asgrey branch:
> http://github.com/rgommers/scikits.image/tree/asgrey
> I sent Stefan a pull request but grab it there if you need it now.
>
> If you only have grey-scale images setting as_grey to False should do the
> right thing as well.

Seeing the problem Holger reported makes me think that imread's
behaviour is rather counter-intuitive.  Should we not introduce a
dtype flag, so that the outcome type is always as expected?

I.e.

imread('x.png') -> (uint8, uint8, uint8, ...)
imread('x.png', flatten=True) -> uint8
imread('x.png', flatten=True, dtype=float) -> float
imread('x.png', dtype=float) -> (float, float, float, ...)

When it comes to dtypes, surprises are seldom good.

What do you think?

Cheers
Stéfan



More information about the scikit-image mailing list