views:

103

answers:

2

How do I read an image file and decode it using Python?

+6  A: 

Broad answer: you should look at the Python Imaging Library. The tutorial should help get you started.

If you run into any specific problem you can always come back to Stack Overflow :)

Manoj Govindan
+3  A: 

Hello StackOverflow,

I'm new to the community and here is my contribution. The word "read" is vague, but here is an example which reads a jpeg file using the Image class, and prints information about it.

import os,sys
import Image
jpgfile = Image.open("picture.jpg")

print jpgfile.bits, jpgfile.size, jpgfile.format

I hope this helps. ~The Gentle One

TheGentleOne
Nimmy