Image to numpy-array: JPG vs. PNG?

I solved the problem with the information I got from this page.

Up vote 4 down vote favorite share g+ share fb share tw.

My system: Mac OS X 10.7 Python 2.7.1 NumPy version 1.5.1 My code: image = openImage(fileDir) print image image = np. Asarray(image) print image If I run this: python main. Py 1010.

Png the output is: 226 226 226 ... ` If I run this: python main. Py google. Jpg the output is: I cannot figure out why numpy can converts png's but can't do it on jpg's, why?

How can I solve this? Edit: ok tried with image.show() and got following error-message: IOError: decoder jpeg not available I solved the problem with the information I got from this page: http://mariz.org/blog/2007/01/26/mac-os-x-decoder-jpeg-not-available/ python numpy png pil jpg link|improve this question edited Jan 21 at 13:09 asked Jan 20 at 22:358bui314.

Most likely you're missing the jpeg library, libjpeg, or so. I had a similar problem lately. I'm not sure how you install it on a Mac, but you have a starting point, at least.

– Cornel Ghiban Jan 20 at 22:38 I installed libjpeg and tried it again, but it didn't work ): – 8bui Jan 21 at 12:47 5 @8bui you should add your solution as an answer and accept it – jterrace Jan 21 at 15:05.

I solved the problem with the information I got from this page: mariz.org/blog/2007/01/26/mac-os-x-decod....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions