How to Find Resolution of an Image in Python

Опубликовано: 24 Октябрь 2024
на канале: Programmer Banda
286
5

In this video I showed the process of finding resolution of image in python without library.
we opened the image in binary mode. Non-text files must be open in this mode. The height of the image is at 164th position followed by width of the image. Both are 2 bytes long.

Note that this is true only for JPEG File Interchange Format (JFIF) standard. If your image is encode using other standard (like EXIF), the code will not work.

We convert the 2 bytes into a number using bitwise shifting operator. Finally, the resolution is displayed.

#shorts #python #image #resolution #Shorts #youtubeshorts
If you found the video valuable, please leave a like and subscribe ❤️ It helps the channel grow and helps me pumping out more such content.