How do I get the picture size with PIL?

I159 picture I159 · Jun 22, 2011 · Viewed 366.1k times · Source

How do I get a size of a pictures sides with PIL or any other Python library?

Answer

phimuemue picture phimuemue · Jun 22, 2011
from PIL import Image

im = Image.open('whatever.png')
width, height = im.size

According to the documentation.