2

After upgrading to Ubuntu 22.04 I was pleasantly surprised that creating images with the new AVIF or HEIC formats was supported by default.

It's a breeze.

convert image.png image.avif
convert image.png image.heic

Unfortunately transparency is not working; converted to black in both formats.

So, is there any special setting needed to create transparent AVIF or HEIC images with convert?

2
  • Have you tried creating a transparency with the -transparent color options? List of color names recognised by convert: imagemagick.org/script/color.php#color_names For example: convert image.png -fuzz 4% -transparent white image.heic with the fuzz option catching small variations of white in the image.
    – andrew.46
    Commented Jun 2, 2022 at 10:15
  • Yes, I did try with -transparent, but no luck, did also try your suggestion with -fuzz, but not working.
    – Janghou
    Commented Jun 3, 2022 at 18:16

2 Answers 2

1

What version of ImageMagick are you running?

I was previously running 6.9 via the Ubuntu apt repository (i.e. apt install imagemagick) and had the same issue.

I uninstalled it and got the latest AppImage from here: https://imagemagick.org/script/download.php#linux and made it executable with chmod a+x magick and then moved it to the usr/bin folder so I can run magick anywhere.

The main difference is that your commands will look like magick convert ... instead of convert ... and also the AVIF issue is resolved :)

EDIT: it seems the actual MIME type resulting is an image/png rather than image/avif. Compiling ImageMagick with heic delegation manually seems like it should work.

I am not sure if it is intended behaviour for the AppImage, it seems like compiling manually may be the only way for now.

5
  • Thx, for confirming this is a bug. Hopefully they will backport a fixed version for 22.04, or offer a SNAP/Flatpak version of imagemagick, which is a suitable candidate IMHO. Better update mechanisms and CLI integration then AppImage.
    – Janghou
    Commented Jun 28, 2022 at 9:16
  • 1
    Actually I tried what you did and it doesn't work here, it's creating a PNG file with .avif extension.
    – Janghou
    Commented Jun 28, 2022 at 15:27
  • 1
    @Janghou it seems you are correct, I'd recommend using avifenc instead if you can Commented Jun 29, 2022 at 10:10
  • 1
    @Janghou I have received some clarification that the AppImage does not support AVIF: github.com/ImageMagick/ImageMagick/discussions/… Commented Jun 29, 2022 at 17:08
  • 1
    Currently the best way as far as I know is to compile it manually e.g with imei.sh as it seems the Ubuntu repo only serves 6.9 which does not support AVIF and the AppImage from ImageMagick does not support AVIF (yet). I am unaware if there is a PPA or not. Commented Jun 29, 2022 at 17:10
0

This is a known issue with ImageMagick 6.9.11 which is shipped with Ubuntu 22.04: https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/1980124

Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040307

Consider building ImageMagick from sources to get a newer version, or upgrade to the next Ubuntu LTS release when it comes out.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .