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) Why? Thanks [code] from pylab import * imgGrayPng=imread('python-gray.png') print (imgGrayPng.shape) #(128, 128, 3) imgGrayJpg=imread('python-gray.jpg') print (imgGrayJpg.shape) #(128, 128) imgColorPng=imread('python-color.png') print (imgColorPng.shape) #(128, 128, 4) imgColorJpg=imread('python-color.jpg') print (imgColorJpg.shape) #(128, 128, 3) [/code] ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users