If Pillow library is not installed, then first install it using this code.
pip install Pillow
The image should be in the same folder in which the code file is running. Otherwise, add the location before the image name.
# Import the Pillow library from PIL import Image # Read the Image img = Image.open("man.jpg") # Display the Image img.show() # Print the type of Image print(type(img))