AVIF and WebP
AVIF and WebP are modern image formats that give the same visual quality as JPEG and PNG at a much smaller file size, and are supported by all current browsers.
WebP was released by Google in 2010; AVIF, based on the AV1 video codec, followed in 2019 from the Alliance for Open Media. AVIF usually compresses best, WebP encodes faster, and both support transparency.
Browsers announce which formats they accept, so a server can send AVIF to those that support it and fall back to WebP or JPEG for the rest.
How Regular approaches it
Standard's image proxy reads the browser's Accept header and serves AVIF, WebP or the original format, in that order of preference.
Sources and further reading
- AVIF, Wikipediaen.wikipedia.org
- WebP, Wikipediaen.wikipedia.org
- Image file type and format guide, MDN Web Docsdeveloper.mozilla.org