Jpeg-XL's key win was only lossless translation of existing jpeg to a modern format. Mostly for archives where you don't want a lossy translation.
In terms of picture quality for given size, AVIF has it solidly beat.
I don’t feel like the difference matters all that much. Both AVIF and jpeg xl produce reasonably sized files for your personal photo library. What you really care about is capabilities for things like HDR and expanded color spaces which both formats seem to have excellent support for.
Just about anything is better than jpeg these days.
> Jpeg-XL's key win was only lossless translation of existing jpeg to a modern format.
Huh?
JpegXL is the only widely supported format (once it comes to the various browser as is planned) that can store true HDR linear images in floating point (fp16 and fp32) formats.
AVIF can only do 10 bit integer ranges, sure that HDR compared to 8bit but it is not sufficient for useful extended range color spaces.
You could make an argument that we should have AVIF everywhere on the web. But if you want a single image format to be everywhere, I think JPEG-XL is just better suited. AVIF has restrictions on resolutions and number of planes, and doesn't do lossless very well. It's competitive with AVIF on lossy image quality (even though yes, AVIF does seem like it tends to consistently have the advantage there).