Convert android screenshots to AVIF
Jpeg or png based phone screenshots are huge, we dont want that. AVIF is excellent free and open image format for many purposes. AVIF image is basically a singular AV1 video frame in a HEIF container.
Install tools#
Imagemagick is bad with multithreading so we use GNU parallel to utilize all CPU cores. Otherwise excellent graphicsmagick doesn’t know how to write avif at the time of writing, so we are stuck with IM.
sudo apt install imagemagick parallel
Compress all the things#
Mount the image directory over sshfs or rclone etc.
Android path is typically something like /sdcard/Pictures/Screenshots
Cd inside the proper mountpoint.
Original files are left behind so clean those up later.
find -type f | grep -Ei '(jpg|png)$' | parallel mogrify -format avif
Comparison#
Screenshot of android home screen, encoded in different formats

Great success!