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