How do I get the picture size with PIL?

前端 未结 7 1629
粉色の甜心
粉色の甜心 2020-11-28 18:15

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

7条回答
  •  星月不相逢
    2020-11-28 18:43

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

    According to the documentation.

提交回复
热议问题