From: Fabrice S. <si...@lm...> - 2015-04-14 12:28:02
|
Le mardi 14 avril 2015 à 18:15 +0800, oyster a écrit : > I am using anaconda(Python 2.7.6 |Anaconda 1.9.2 (32-bit)| (default, > Nov 11 2013, 10:50:31) [MSC v.1500 32 bit (Intel)] on win32) on > windows 7 64 bits > And the matplotlib is 1.4.3, numpy is 1.9.2, and scipy is 0.15.1, > which are all been updated by 'conda update xx' > > As http://matplotlib.org/api/pyplot_api.html says > [quote] > matplotlib.pyplot.imread(*args, **kwargs) Read an image from a file > into an array. > > Return value is a numpy.array. For grayscale images, the return array > is MxN. For RGB images, the return value is MxNx3. For RGBA images the > return value is MxNx4. > [/quote] > > But if I read a 128*128*8 BPP gray PNG file, the array.shape is (128, > 128, 3); if I read a 128*128*24BPP color PNG file, the array.shape is > (128, 128, 4) Are you sure your png "24bpp" does not have a transparency channel? -- Fabrice |