Questions tagged [avif]

51 questions
18
votes
4 answers

Why doesn't Edge Support AVIF images?

Chrome and Firefox have supported AVIF images for some time now, and it is my understanding that Edge is based on Chromium, which caused me to assume that it too would support AVIF images. However, I just tested an AVIF dependent application in Edge…
Lonnie Best
  • 9,936
  • 10
  • 57
  • 97
11
votes
3 answers

How to convert JPG images to AVIF with Python

Python's Pillow doesn't seems to support AVIF files yet, and other packages like pyheif, only support reading. Is there any Python tool to convert jpg images to the new avif format?
Ander
  • 5,093
  • 7
  • 41
  • 70
10
votes
1 answer

Create image from Canvas with AVIF image format

AVIF a very promising image format/codec which based on the sample is far better than JPEG. My question is how do you create a AVIF image from a Canvas? So instead of JPEG, something like: canvas.toBlob(function (blob) {}, "image/avif", 1.0) Is…
quarks
  • 33,478
  • 73
  • 290
  • 513
7
votes
3 answers

How to check if the browser supports AVIF images

How can I detect if the browser supports AVIF images using JavaScript? I have viewed this question and after reading the answers I was able to build a useful one-liner function to check browser support for various image types. const isSupported =…
6
votes
1 answer

Does FFmpeg currently support AVIF?

I installed FFmpeg using Chocolatey and confirmed that it is the latest version. In order to convert the png file into an avif file, I gave the command as below in the cmd window of the administrator's authority. ffmpeg -i input.png…
user19098011
  • 73
  • 1
  • 3
6
votes
1 answer

Prioritize avif format with background-image css property

I refactored my app with avif format for phone devices (even if it's not supported everywhere). This code works perfectly, it prioritize avif format if it's supported by the browser:
PestoP
  • 247
  • 2
  • 11
6
votes
3 answers

Fallback Background Images loads in Firefox

I have been working on my websites page speed improvement. I planned to use AVIF format images. This image format is supported only in the latest Chrome browser versions. In order to provide a fallback image, I have used this CSS: .banner-bg { …
Dinesh M
  • 1,026
  • 8
  • 23
5
votes
1 answer

PHP8.1 - how do I get imageavif() to work?

I recently upgraded my PHP version to 8.1-fpm and also upgraded Debian to Bullseye. I read somewhere that Bullseye comes with AVIF support but when I try to use imageavif(), I get the following error: PHP message: PHP Fatal error: Uncaught Error:…
user1413341
  • 226
  • 3
  • 17
4
votes
2 answers

smallest valid base64 AVIF image

I would like to find the smallest possible, but valid (viewable) base64 encoded AVIF string for testing browser image support with javaScript. I'm using this set: const imgs = { jxl: "/wr6HwGRCAYBAFAASzhB5k11/Ia1kyog0AHeH0nCAVw=", avif:…
stenito
  • 51
  • 2
2
votes
1 answer

How do display .avif images in not supporting browsers?

i want to all my big .png files to .avif . But Browsers like MS Edge etc. do not support .avif images. Is there any way to display .avif files in f.e. Edge, or provide the Browser two images (.png and .avif) and the browser decides, which image to…
2
votes
1 answer

unable to open for write unix error: No such file or directory. How to fix?

I'm trying to convert png to avif via Sharp, but I'm getting an error. Code example const image = sharp(`./images/img/original/image.png`) .avif({quality: 70, loseless: true}) .toFile(`/images/img/avif/out.avif`) Error [Error:…
Zorome
  • 106
  • 8
2
votes
1 answer

Responsive images: Picture element using width and height of fallback tag when using AVIF/WEBP

I have a website that I have made responsive and utilise the element to serve up webp, avif and have a png fallback for older browsers. It should look like this (Chrome/Safari): For some reason, certain browsers (Firefox 94 on desktop and…
Myles Gray
  • 8,711
  • 7
  • 48
  • 70
2
votes
2 answers

How to get image dimensions from an avif file?

I'm looking for a (fast) way to retrieve image metadata from an avif-file in my java-application. This is currently done for many image formats by analyzing the raw header bytes of a file. I can recognize a file as avif through the magic byte…
Jochen Go
  • 21
  • 3
2
votes
3 answers

How to create avif files in php?

Does anybody know how to write avif image files in php? For webp files i have the function imagewebp. But avif? Using PHP Version 7.4, 7.1 and 7.2 on different servers. thanks a lot
altesCoon
  • 47
  • 1
  • 5
2
votes
1 answer

Convert png images to lossy avif

I try to compress my ~1MB pngs to get a smaller image. When I compress my images to jpeg with: for i in card*.png ; do convert -resize 445x625 -background white -flatten "$i" ../medium/"${i%.*}.jpg" ; done they end up about 100kb So I tried for i…
rubo77
  • 19,527
  • 31
  • 134
  • 226
1
2 3 4