From: Fabrice S. <si...@lm...> - 2015-04-16 15:23:31
|
Le jeudi 16 avril 2015, oyster a écrit : > Firstly, thanks, Fabrice Silva > > I have checked my picture files again. > > For python-gray.png, now it is attacched here or can be downloaded > from http://bbs.blendercn.org/data/attachment/forum/201504/16/222351w3952n3o9968m9a5.png. > xnview says it is 128*128*8, but "print > imread('python-gray.png').shape" says (128, 128, 3), however I suppose > it should be (128, 128)! Funnily (or not), the png is in fact 8-bits depth so you could infer it is grayscale, but matplotlib is right : your file uses a color palette. The 8-bits values refer to indices of the 256-length color palette. These indices are then converted back to the colorspace, so the shape is eventually (...,3). Unfortunately, the color palette is here the grayscale... -- Fabrice |