Created
September 14, 2022 08:43
-
-
Save koss822/797ab168458b60cf854dab09ba649c6f to your computer and use it in GitHub Desktop.
Convert all webp files in directory to png
This file contains 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 pathlib import Path | |
from PIL import Image | |
import os | |
p = Path('.') | |
for file in p.glob('*.webp'): | |
im = Image.open(file) | |
im.save(f"{file}.png", "png") | |
os.remove(file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment