Determining an Image Size?

Greg Landrum gReGlAnDrUm at
Sat May 19 03:01:01 CEST 2001

"Darren Watson" <Darren.Watson3 at> wrote in message
news:KjiN6.4874$Od1.660453 at
> Hi
> I know very little about image formats, but I am very interested in
> out if it is possible to determine the dimensions (in pixels) of a JPEG or
> GIF file from a Python script.

If you have PIL installed
(, you can just do:
>>> from PIL import Image
>>> img ='icon.jpg')
>>> img.size
(66, 81)

I hope this helps,

More information about the Python-list mailing list