from PIL import Image import sys img=Image.open("A8.jpg") width=img.size[0] height=img.size[1] print (width,height)