JXL allows for progressive rendering (e.g. it can only los an image partially)
JXL is faster
JXL has better compression on higher quality levels
AVIF is better for low fidelity images
JXL was made for images only, whereas AVIF comes from Video frames. Technically JXL is superior in most categories. I can’t tell for the license what is better.
Also: JPEG can be losslessly converted to JXL. Typically converting from one lossy format to another lossy format decreases quality. But in case of JXL, you can take old JPEGs and make them smaller without losing information.
https://avif.io/blog/comparisons/avif-vs-jpegxl/
IMO the most important points:
JXL was made for images only, whereas AVIF comes from Video frames. Technically JXL is superior in most categories. I can’t tell for the license what is better.
Also: JPEG can be losslessly converted to JXL. Typically converting from one lossy format to another lossy format decreases quality. But in case of JXL, you can take old JPEGs and make them smaller without losing information.