+4 votes
in Programming Languages by (71.8k points)
I want to convert a .webp image file into a .png file. Is there any Python library for this?

1 Answer

+1 vote
by (353k points)
selected by
Best answer

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 Image

webpfile = "webpfilename.webp"
pngfile = "pngfilename.png"
im = Image.open(webpfile)
im.save(pngfile, format="png", lossless=True)