News for hackers. Stuff that matters.
Re:Using Saliency in progressive JPEG XL images by ksec on Friday September 10, 2021 @02:57AM (#28478536)
Can I use JPEG XL Yet [1] ?

Again Image / Video / Audio Codec Support on Safari requires OS update. Unless this is on their agenda for iOS 16 and next macOS, which I doubt, it will likely be a few years before support of it becomes widely available.

[1] https://caniuse.com/jpegxl

Re:Using Saliency in progressive JPEG XL images by zebracanevra on Friday September 10, 2021 @03:45AM (#28478798)
It doesn't matter too much (for the web) as you can use <picture> and <source> and specify multiple jxl/avif/webp/jpeg sources, and the browser will choose the first type it understands. These elements are widely supported.

Hopefully JXL doesn't become yet another image format (927)... some features of it are incredible. For example, you can have mixed lossless/lossy content in one image. No longer will you need to choose between a lossy or lossless format: the encoder would intelligently segment the image.

Re:Using Saliency in progressive JPEG XL images by est31 on Friday September 10, 2021 @06:32AM (#28479688)
> you can have mixed lossless/lossy content in one image. No longer will you need to choose between a lossy or lossless format: the encoder would intelligently segment the image.

What's the advantage of that? If I'm dissatisfied with the compression quality in some areas, I can tweak the quality parameter already.

Re:Using Saliency in progressive JPEG XL images by zebracanevra on Friday September 10, 2021 @06:47AM (#28479770)
See https://github.com/libjxl/libjxl/pull/466 for more details.

As far as I understand it, the synthetic mode compresses better for (as you can guess) synthetic content. So if you're encoding a mixed content screenshot, you'll get better quality and size by encoding the photos and UI separately.

Re:Using Saliency in progressive JPEG XL images by est31 on Friday September 10, 2021 @06:58AM (#28479843)
Oh I see, that makes sense.
Re:Using Saliency in progressive JPEG XL images by Dylan16807 on Friday September 10, 2021 @03:32AM (#28478719)
I'm surprised that there seem to be no polyfills.
Re:Using Saliency in progressive JPEG XL images by chrismorgan on Friday September 10, 2021 @07:14AM (#28479934)
Polyfills for image and video formats are pretty much never going to be worth it: they’ll be a fairly hefty chunk of code (so you’ll need a lot of shrunk-by-using-the-polyfilled-format images to balance it out), and they’ll load much more slowly than the native (so that lot of images is now a liability), while not being able to smooth loading the way stuff native to the browser does. I don’t think a compelling reason to do it that way has ever or is ever likely to exist; it’s an all-round bad idea in practice. Just fall back to a different format, that’s what <picture> is designed for.
Re:Using Saliency in progressive JPEG XL images by Dylan16807 on Friday September 10, 2021 @04:46PM (#28486693)
I'm not sure how big a jxl decoder has to be, but there's a wasm webp decoder that zips to about 50KB. That kind of cost pays for itself very quickly.

And whether it loads faster or slower depends on your connection. But yes it hurts to not get the smoothness benefits.

Re:Using Saliency in progressive JPEG XL images by chrismorgan on Saturday September 11, 2021 @12:39AM (#28489469)
Hmm… https://webmproject.github.io/libwebp-demo/webp_wasm/index.h... ships 141KB/54KB (bytes/transferred) of WASM and 116KB/34KB of JavaScript, including lots of bogus SDL stuff. https://kenchris.github.io/wasm-webp/ is 120KB/44KB of WASM and 30KB/9KB of JavaScript, much more reasonable. (Incidentally, I never like the JavaScript such tools produce; it’s always hideously unoptimised. Experience suggests to me that I could reduce that 30KB to under 10KB with a little effort, and possibly to under 5KB; and if I could touch the WASM as well, still further.)

Definitely smaller than I thought I recalled, and WASM bytes are no dearer than image bytes, though JS bytes are much more expensive, so it’s closer to just the more expensive decoding of the actual images that’ll bite you. Plus the not-integrated loading experience, of course.