Created
November 11, 2022 22:32
-
-
Save bpgould/f5e4ea1593c94615ba8a4903539ab984 to your computer and use it in GitHub Desktop.
convert webp images 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
''' | |
convert webp images to png | |
''' | |
from sys import argv | |
from PIL import Image | |
# requirements: `pip install pillow` | |
# example usage: | |
# python main.py input.webp output.png | |
IMAGE_WEBP = "input.webp" | |
IMAGE_PNG = "out.png" | |
if argv[1]: | |
IMAGE_WEBP = argv[1] | |
if argv[2]: | |
IMAGE_PNG = argv[2] | |
im = Image.open(IMAGE_WEBP) | |
im.save(IMAGE_PNG, format="png", lossless=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment