+4 votes
in Programming Languages by (20.4k 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 (48.9k points)

You can use methods from the PIL package to convert an image from one format to another format.

Here is an example:

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


...