image-formats

How to get the format of image with PIL?

How to get the format of image with PIL? Question: After loading an image file with PIL.Image, how can I determine whether the image file is a PNG/JPG/BMP/GIF? I understand very little about these file formats, can PIL get the format metadata from the file header? Or does it need to ‘analyze’ the data within …

Total answers: 1