Consider building with JPEG-XL (JXL) support
Please consider building with JPEG-XL (JXL) support in Tor Browser
JPEG-XL support is currently experimental in Firefox Nightly builds. It produces files that are less than half the size of their equivalent quality JPEG files, has a very small header, and supports progressive decoding that can already show the full frame after only about 10% of the file is loaded, which would be beneficial for sites that are designed with Tor in mind. Information about the format: https://jpegxl.info/ JXL browser test page: https://jpegxl.info/test-page/
The Firefox implementation of JXL currently seems to be incomplete, however some derivative browsers (Waterfox, Pale Moon, Basilisk) recently got full support. Here are the related Waterfox issues for reference: Basic support: https://github.com/WaterfoxCo/Waterfox/issues/2924 Extended support: https://github.com/WaterfoxCo/Waterfox/pull/2938
Some more optional rambling:
To address the elephant in the room: Why not just use AVIF? The problem is that AVIF images don't support progressive decoding, or even sequential decoding. They need to be fully downloaded before anything can be displayed in the browser, which makes it seem very unsuitable for .onion sites. The format seems mainly designed to save CDNs money, not with users in mind.
Video comparing the decoding behavior of JPEG/JXL/AVIF at slow network speeds: https://youtu.be/inQxEBn831w
My personal use case is that I participate in Onionket, a semiannual virtual art festival and fediverse community, that is hosted using onion services, and promotes censorship resistant technology. My main frustration is, that to get good loading times, I can't showcase my images at full resolution in good quality. If I and other participants, could rely on Tor Browser having JXL support out of the box, we could improve image quality and loading times, to be much closer to what people are used to from clearnet sites.