get image width and height python code example
Example 1: python get image dimensions
from PIL import Image
im = Image.open('whatever.png')
width, height = im.size
Example 2: python get image size
from PIL import Image
img = Image.open('path/to/image')
width, height = img.size
im.close()