How to convert AVIF To PNG with Python?
Question:
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.
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')
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.
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')