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