sudo apt install eom webp-pixbuf-loader libimlib2-dev libwebp-dev pkg-config libwebp-dev libgdk-pixbuf2.0-dev libgtk-3-dev
For lossy, neither is in a good place, since lossy AVIF beats both lossy JXL and lossy WEBP. Lossless AVIF is a joke and barely competes with PNG.
Except for gain maps :)
I don't really mind because I don't use them anyway. I prefer to use the client's tonemapper. But they are a useful feature that's not supported by (chrome's implementation of) jxl
And AVIF compression ratio beats JXL only conditionally. E.g. my photo library had AVIF at 29% and JXL at 25% the input size at the same perceptual quality (SSIM2=83). Sometimes it's on par. Sometimes AVIF wins. JXL wins almost always. Not to mention you can losslessly, reversibly transcode lossy JPG files to JXL, getting significant size reduction for free.
WebP timing turned out to be true on a few years old tablet, but not on a newer phone nor desktop; the number of large cores determines that time for JXL. The CPU time is probably lower for WebP, didn't measure that. But wall clock tells a different story, and the encode times and size bury WebP.
AVIF is a strange format since its lossy compression can _improve_ when you add a smaller layer; it's smaller than WEBP in the normal modes (s6; s>=7 switches to real-time mode which sucks and s3 takes centuries), sure. But even it decodes faster than WebP in favorable chip conditions. And JXL via Jixel just eats both for breakfast with plenty of room to spare.