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