2009/10/21 Stéfan van der Walt stefan@sun.ac.za
2009/10/21 Ralf Gommers ralf.gommers@googlemail.com:
There is a dtype argument already, you merged my patch for that, commit 44679c7aae5d6b3747c88d46756a3dc96c9a727f.
Oh yes, of course :)
My point remains, however, that the default for dtype may have to be changed for consistency.
Don't think I would agree with that. dtype=None is consistent with how NumPy does this. See for example np.array / np.asarray.
Currently, you have to read the docs to
figure out what type will be returned, and I feel that element of surprise can be eliminated simply by specifying the default dtype=float or dtype=np.uint8.
The returned type by default is the type the image was saved as. To me that is the only thing that makes sense.
The only thing you have to look up in the docs is what dtype you get when specifying flatten=True. Since you explicitly ask for color -> grey-scale conversion, a sensible type has to be chosen if it's not specified. The smallest type that makes sense is float32.
Cheers, Ralf
Cheers Stéfan