Created
July 13, 2016 11:11
-
-
Save TimSC/186d807e661345cc140b7728531d8570 to your computer and use it in GitHub Desktop.
Python 2, convert pngs in a folder to jpgs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import os | |
| for fina in os.listdir("."): | |
| finas = os.path.splitext(fina) | |
| if finas[1] != ".png": continue | |
| img = Image.open(fina) | |
| img.save(finas[0]+".jpg") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment