Python Program to Find the Size and Dimension of an Image

In this example, we will write a python program to find the size and dimension of an image. To better understand this example, make sure you have knowledge of the following tutorials:-

Here is the code to find size and dimension of an image named “sample_image_file.jpg”, the sample is as provided.

The output of the program is:-

The size of file is 66027 bytes
The dimension of the image is 768 x 512

Python Program to Find Dimension of an Image using PIL module

For this, you need to install PIL using pip install PIL.

The output of the program is:-

The dimension of the image is 768 x 512
SHARE Python Program to Find the Size and Dimension of an Image

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Share