AVIF libraries for Python
Two libraries cover AVIF in Python:
- Pillow reads and writes AVIF out of the box since version 11.3 (the wheels include libavif with dav1d and libaom). Pick it for everyday scripts and web apps that already use Pillow. It works with 8-bit images only: 10/12-bit and HDR AVIF are converted to 8 bits.
- pyvips wraps libvips: faster and lower memory for large images and batch thumbnails, and it keeps 10/12-bit precision.
On Pillow older than 11.3, the pillow-avif-plugin package adds AVIF support; it’s now merged into Pillow.
- Pillow Pillow reads and writes AVIF in Python since version 11.3. How to convert JPEG and PNG to AVIF, set quality and speed, save animated AVIF and keep Exif.
- pyvips pyvips is the Python binding of libvips. How to install it, convert images to AVIF, make AVIF thumbnails, set quality, effort and bit depth.