Picture resolution and PIL

J

Johny

Is it possible to find out a picture resolution by using PIL package?
Thanks for help
L.
 
B

bearophileHUGS

Johny:
Is it possible to find out a picture resolution by using PIL package

By Gian Mario Tagliaretti:
import PIL.Image
a = PIL.Image.open("foo.jpg")
a.info["dpi"]
(72, 72)

(It may raise an exception if that information isn't available)
I don't know if that can be used to read the DPI tag inside a TIFF
image.
You can also read the pixel size of any image.

Bye,
bearophile
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top