logo hsb.horse
← Back to blog index

Blog

Converting Images to AVIF Format with libavif

How to install libavif via Homebrew and convert JPEG/PNG to AVIF format. Supports single conversion and batch processing.

Published: Updated:

Translations

Convert JPEG/PNG to AVIF format using libavif.

Environment

  • macOS Sonoma
  • Apple M2 MacBook Pro

Install libavif

Install via Homebrew.

Terminal window
brew install libavif

Convert JPEG/PNG to AVIF

Convert single file with the following command.

Terminal window
avifenc input.jpg output.avif

Convert All Images in Directory

For batch processing all images in a directory with shell, prepare a batch processing script.