Image file formats
October 16, 2018 — September 17, 2023
Modern image formats, for my reference, with particular attention to the ones that are good for the web. Many guides to this, see e.g. avif.io. Notes here are for my purposes in particular.
Note that despite the apparently benign nature of tacking a representation of pixels from a file and putting it on a screen, image libraries have a long history of security bugs, including disastrous ones.
1 WebP
WebP image format is supported on most modern browsers. Notably, things that are not browsers are a bit crap at WebP, so chat programs and feed readers fail to create thumbnails of websites using WebP. Probably they will only support GIF89a until the end of time. That is why sometimes the page previews for this site look a bit crap; I use WebP quite a lot.
Famous WebP security vulnerability: CVE-2023-4863; tl;dr all software using WebP before 2023-09-14 was vulnerable to remote code execution.
2 AVIF
The most futuristic image format with reasonable support, i.e. 90%+ of browsers. It will even work in Microsoft Edge in the next version, supposedly. It was briefly going to be in Microsoft Edge, but they seem to have changed their minds. Like WebP, many non-browser apps are no good at AVIF, so some websites fail to render AVIF thumbnails; but that won’t stop me from using it. I’m not being paid to work around the deficiencies of other people’s software.
After much experimentation I am switching the etching and engraving artwork on this blog to AVIF; it looks much nicer and a much smaller file size.
- Can I use AVIF image format
- GIMP supports AVIF! Learn how to use it.
- online AVIF Converter
- If I were impatient I might try to shoehorn support into tardy browsers by Kagami/avif.js: AVIF polyfill for the browser. I do not have time, however, and for now the Microsoft Edge holdouts can live with the inferior experience of broken images on this site.
3 JPEG2000
4 JPEG XL
5 Even fringier options
bpg…
Something in my heart yearns to develop AI image codecs.
6 Previewing in macOS
See macOS image preview.
7 Bonus: mass conversion
I like to convert my ultra-high-res TIFFs to still-very-large-but-manageable AVIFs with minimal loss of quality but a huge reduction (75%+?) in file size: