image shape in PIL code example Example: PIL image shape from PIL import Image im = Image.open('whatever.png') width, height = im.size