How to convert avif to png on Ubuntu

To convert AVIF images to PNG on Ubuntu, you can use libavif-tools, which includes the tool avif2png.

1. Install libavif-tools

On Ubuntu (including 22.04), install libavif-tools:

sudo apt install libavif-tools

This package includes avif2png.

2. Convert AVIF to PNG

To convert a single AVIF image to PNG:

avif2png input.avif output.png

3. Batch Conversion

If you need to convert multiple AVIF images in a directory:

for file in *.avif; do avif2png "$file" "${file%.avif}.png"; done

This command loops through all .avif files and creates corresponding .png files.

4. Additional Options

To view available options, you can check the help menu:

avif2png --help

This will show options like setting output quality or handling errors.

5. Example

Convert image.avif to image.png:

avif2png image.avif image.png

You’re all set to convert AVIF images to PNG on Ubuntu! Let me know if you encounter any issues.

Leave a Reply

Your email address will not be published. Required fields are marked *