|
From: oyster <lep...@gm...> - 2015-04-16 14:52:04
|
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)! For python-color.png, it is my fault. xnview says it is 128*128*32, so it has alpha channel. Hence "imread().shape =(128, 128, 4)" is right btw. imread return array which has value between 0 and 1 for PNG file. But for other picture format, the value is 0~255. The manual says matplotlib reads PNG only by it self, and other files via PIL.But I think it is better to make the returned array consistent. |