If you are getting Python PIL, pil.unidentifiedimageerror: cannot identify image error, then follow below steps to resolve it.
- Check whether the image you are using is supported by PIL or not
- If you are processing images from a folder, go to the folder, unhide the files, check whether there are any image files not supported by PIL. Delete them if you find or convert to PIL supported format.
- Sometimes, when your python code is terminated in between while you are processing any image or images, temporary image files will be created in that image’s folder. So, when you run the code next time, you will encounter Attribution error:Image.open() cannot identify image file. So, follow the second step in such case.
Also see: python pillow tutorial with examples