Created
March 7, 2024 09:46
-
-
Save allyunion/ad90c8dd33ee59033f8d84f11d195560 to your computer and use it in GitHub Desktop.
Convert WEBP to GIFs
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
#!/usr/bin/env python3 | |
import os | |
from PIL import Image | |
for root, dirs, files in os.walk("."): | |
for filename in files: | |
if '.webp' in filename: | |
new_filename = filename.replace('.webp', '.gif') | |
im = Image.open(filename) | |
im.info.pop('background', None) | |
im.save(new_filename, 'gif', save_all=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment