Skip to content

Instantly share code, notes, and snippets.

@koss822
Created September 14, 2022 08:43
Show Gist options
  • Save koss822/797ab168458b60cf854dab09ba649c6f to your computer and use it in GitHub Desktop.
Save koss822/797ab168458b60cf854dab09ba649c6f to your computer and use it in GitHub Desktop.
Convert all webp files in directory to png
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