How to read image file using Python?

How to read image file and decode it using Python?

+42
python file image
Sep 17 '10 at 13:08
source share
1 answer

The word β€œreading” is vague, but here is an example that reads a jpeg file using the Image class and prints information about it.

from PIL import Image jpgfile = Image.open("picture.jpg") print jpgfile.bits, jpgfile.size, jpgfile.format 
+34
Sep 17 '10 at 15:05
source share



All Articles