A minimal script that converts all jpg/jpeg/png files under a directory to .avif.
Uses find -print0 and read -d '' to handle filenames containing spaces.
#!/usr/bin/env bashset -euo pipefail
while IFS= read -r -d '' file; do avifenc "$file" -o "${file%.*}.avif" >/dev/null 2>&1done < <( find . -type f \( -name '*.jpg' -o -name '*.jpeg' -o -name '*.png' \) -print0)Notes
- If a
.aviffile with the same name already exists, it will be overwritten - To see conversion logs, remove
>/dev/null 2>&1
hsb.horse