You can use methods from the PIL package to convert an image from one format to another format.
Here is an example:
from PIL import Imagewebpfile = "webpfilename.webp"pngfile = "pngfilename.png"im = Image.open(webpfile)im.save(pngfile, format="png", lossless=True)
from PIL import Image
webpfile = "webpfilename.webp"pngfile = "pngfilename.png"im = Image.open(webpfile)im.save(pngfile, format="png", lossless=True)