How can I find the resolution of an image with any extension without using any module that is not part of Python’s standard library (except perhaps PIL)?
>Solution :
You can get an image’s resolution with the Pillow package:
from PIL import Image
with Image.open("filename") as image:
width, height = image.size
You can find more in the documentation