How to get the size of an image with PIL in Python

Getting the size of an image with the Python Image Library (PIL) returns its width and height in pixels.

Solution for How to get the size of an image with PIL in Python : You can use PIL.Image.Image.size to return the size of an image Call PIL.Image.open(fp) to open an image with the filename fp. Use PIL.Image.Image.size with this opened image to return a tuple containing the width and height in pixels.


how-to-get-the-size-of-an-image-with-pil-in-python