Search code examples
pythonpython-imaging-libraryimage

How do I get the picture size with PIL?


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


Solution

  • from PIL import Image
    
    im = Image.open('whatever.png')
    width, height = im.size
    

    According to the documentation.