Score:3

How can I convert an avif image file to a png file?

us flag
Tim

How can I convert an avif image file to a png file?

$ convert macadamiaCracker1.{avif,png}
convert: Decoder plugin generated an error: Unspecified (7.0) `macadamiaCracker1.avif' @ error/heic.c/IsHEIFSuccess/135.
convert: no images defined `macadamiaCracker1.png' @ error/convert.c/ConvertImageCommand/3325.

where

$ file macadamiaCracker1.avif
macadamiaCracker1.avif: ISO Media, AVIF Image

Was convert updated to support avif after ImageMagick 7.1.0-45?

$ convert --version
Version: ImageMagick 7.1.0-45 Q16-HDRI x86_64 d80f6a7cd:20220731 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(4.5) 
Delegates (built-in): bzlib cairo djvu fontconfig freetype heic jng jp2 jpeg jxl lcms lqr lzma openexr png raw rsvg tiff webp x xml zlib
Compiler: gcc (11.3)
Score:1
sa flag

Check if a file is avif. If FILE.avif is avif, the results of file FILE.avif should be:

FILE.avif: ISO Media, AVIF Image

Convert an individual file from avif to png:

convert FILE.avif FILE.png

Convert all .avif files in a directory from avif to png:

for image in *.avif ;  do convert "$image" "${image%.*}.png" ; done
Tim avatar
us flag
Tim
Thanks. Does `convert` in ImageMagick 7.1.0-45 support avif?
karel avatar
sa flag
My ImageMagick in Ubuntu 22.04 is version 6.9.11.60, and the commands were tested with this version and work perfectly with avif files. I haven't tested the commands with version 7.1.0-45, but I used similar commands to convert files from avif to png with earlier versions of ImageMagick and they worked OK. btw the gThumb app in Ubuntu can view .avif files natively.
Score:0
cn flag

If you are fine using a GUI program for that, then GIMP.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.