Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert AVIF To PNG with Python?

Tags:

python

image

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.

like image 963
lia kim Avatar asked Oct 16 '25 02:10

lia kim


1 Answers

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

Then:

from PIL import Image
import pillow_avif

img = Image.open('input.avif')
img.save('output.png')
like image 67
Cornea Valentin Avatar answered Oct 17 '25 16:10

Cornea Valentin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!