AVIF format compatibility

I have not found info about avif compatibility in discourse.

As you probably know, AVIF is an image file format base in AV1 video compression (opensource) that gives less file size with the same quality or more quality with the same sizes than alternatives (jpeg or webP).
You can use 8bits or 10 and 12 bit discretization to get better color and different color profiles.
Recent browser version support it.

It seems that discourse does not provide support for AVIF.
I have tried to add avif extensions for archive uploads, but it treats them as just a downloadable file.

It good be great to have avif support under discourse.

And it would be yet better if it could serve a jpeg when the browser is not compatible with avif.

Is this feature planned for future discourse releases?
Did I miss something and it is already working in discourse?

I added the necessary ImageMagick libraries to support AVIF files a few months ago, but there still some places where we need to tweak for it to be treated like an image. I was planning for it to be supported in at least 2 major browsers before working on that.

2 Likes

Great to know you are planning on implementing it.
Thank you.

It is a bit early to impose it for our users, but I think it is a great thing for the near future, for our photographers community.
It really does it better than jpeg for the same image size (as long as I could test).

Right now it is supported out of the box in chrome (from version 85 or so) and in firefox it is implemented but you have to activate it. Opera and others seem to implement it too.
Edge is based on chromium, and I have been tested (I use mainly edge).

At first it did not work, but I have downloaded the AV1 codec for windows 10 and updated edge to last version (92+) and it seems it works.
“avif” | Can I use… Support tables for HTML5, CSS3, etc

In some testing site there says my browser does not support it, but I have been comparing in other places the avif and jpeg images and I can see the difference, and comparing to firefox (you have to enable avif in about:config) and it seems to get same results.

So I am not sure but seems edge does support it if windows does (with the codec).
I expect windows to implement that codec by default in the near future, in some upgrade.

Some android phones seem not to support it, others need to activate heif images.

Meanwhile it good be good to provide a jpeg when the avif is not supported by the user browser (if possible).

So for WEBP we just added support for it to be treated like an image and do no transformation on it, because it’s widely supported nowadays. Meanwhile for HEIF we added an unconditional transformation to JPEG, since it isn’t supported in any browser whatsoever.

There is no precedent, in Discourse, of keeping the image in multiple formats and putting all in a picture srcset thing. While it’s doable, it’s also quite a bit of work.