width and height of pil image code example Example: width and height of pil image image = PIL.Image.open("sample.png") width, height = image.size