How to convert AVIF To PNG with Python?


I have an image file in avif format
How can I convert this file to png format?

I found some code to convert jpg files to avif, but I didn’t find any code to reconvert them.

Asked By: lia kim



You need to install this modules: pip install pillow-avif-plugin Pillow


from PIL import Image
import pillow_avif

img ='input.avif')'output.png')
Answered By: Cornea Valentin
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.