News for hackers. Stuff that matters.
Re:First automatic JPEG-XL cloud service by pdntspa on Wednesday September 20, 2023 @01:24AM (#37580656)
Every time I see JPEG XL I always get my wires crossed with JPEG 2000... as in, "Isn't that that weird format I had to use Irfanview to decode?"
Re:First automatic JPEG-XL cloud service by gadtfly on Wednesday September 20, 2023 @01:50AM (#37580800)
I always confuse it with JBIG2, infamous from NSO's Pegasus zero-click iMessage exploit:

> JBIG2 doesn't have scripting capabilities, but when combined with a vulnerability, it does have the ability to emulate circuits of arbitrary logic gates operating on arbitrary memory. So why not just use that to build your own computer architecture and script that!? That's exactly what this exploit does. Using over 70,000 segment commands defining logical bit operations, they define a small computer architecture with features such as registers and a full 64-bit adder and comparator which they use to search memory and perform arithmetic operations. It's not as fast as Javascript, but it's fundamentally computationally equivalent.

> The bootstrapping operations for the sandbox escape exploit are written to run on this logic circuit and the whole thing runs in this weird, emulated environment created out of a single decompression pass through a JBIG2 stream.

https://googleprojectzero.blogspot.com/2021/12/a-deep-dive-i...

Re:First automatic JPEG-XL cloud service by bongobingo1 on Wednesday September 20, 2023 @02:44AM (#37581131)
I imagine writing that exploit was extremely satisfying.
Re:First automatic JPEG-XL cloud service by NetOpWibby on Wednesday September 20, 2023 @03:15AM (#37581320)
I’m glad most people use their powers for good. This is beyond me.

Incredible programming.

Re:First automatic JPEG-XL cloud service by ianlevesque on Wednesday September 20, 2023 @01:17AM (#37580606)
Anyone know the one-liner to losslessly recompress an existing JPEG as a JPEG-XL? That was one of the most interesting features of the format to me.
Re:First automatic JPEG-XL cloud service by fold3 on Wednesday September 20, 2023 @01:29AM (#37580688)
Iirc, cjxl is smart enough to do it automatically.

cjxl input.jpg output.jxl

The cjxl --help and cjxl -v -v --help pages are very well done and you'll find the option to explicitly set the option on if you wish to do so.

Re:First automatic JPEG-XL cloud service by selcuka on Wednesday September 20, 2023 @02:44AM (#37581133)
https://github.com/libjxl/libjxl#usage

> Specifically for JPEG files, the default cjxl behavior is to apply lossless recompression and the default djxl behavior is to reconstruct the original JPEG file (when the extension of the output file is .jpg).

Re:First automatic JPEG-XL cloud service by djkoolaide on Wednesday September 20, 2023 @01:27AM (#37580673)
Assuming imagemagick is installed,

magick input.jpg output.jxl

Re:First automatic JPEG-XL cloud service by sandGorgon on Wednesday September 20, 2023 @02:19AM (#37580969)
Re:First automatic JPEG-XL cloud service by _ache_ on Wednesday September 20, 2023 @03:06AM (#37581247)
From my own tests. JXL is better for photos and competitive with AVIF for images with flat areas of color (PNG-like). JXL is about the same speed as AVIF but WebP is quicker than both.
Re:First automatic JPEG-XL cloud service by sandGorgon on Wednesday September 20, 2023 @04:14AM (#37581725)
JXL is same speed as AVIF ? but what everyone has been commenting is that AVIF is 100x slow
Re:First automatic JPEG-XL cloud service by youngtaff on Wednesday September 20, 2023 @04:48AM (#37581948)
Encoding AVIF is very slow for large images.

Instead of using a breakpoint style approach with several predefined sizes some site generate images related to viewport size at very fine granularity and even changing the viewport by 1px will cause the AVIF to be regenerated

In these cases you can notice services like Cloudinary take several seconds to generate the new variant if it’s a large image

Re:First automatic JPEG-XL cloud service by yoochan on Monday September 25, 2023 @03:08AM (#37640478)
if I understood well, AVIF encoder is quite fast for ugly qualities and very slow for standard and higher quality. https://cloudinary.com/blog/contemplating-codec-comparisons#...
Re:First automatic JPEG-XL cloud service by lifthrasiir on Wednesday September 20, 2023 @05:25AM (#37582172)
Is this your test, just in case? https://ache.one/articles/web-image-formats

I'm not very sure how you have compared the speed. `cjxl -e 9` for example is known to be very slow because it is AFAIK basically `-e 8` with a brute-force parameter search (and I think this level should be hidden in some way for this exact reason, it is very misleading). Also I assume that you have done an end-to-end command line test with relatively small inputs, which might be a major pitfall (because it doesn't only measure the PNG encoder/decoder but also all program invocation time and finalization time, which can be specficially optimized [1]).

Also only relying on a single objective metric might be misleading, and Jon Sneyers (one of JPEG XL devs) has a very good plot that illustrates this [2] and pointed out that actual images have to be also manually reviewed to reduce mistakes. Many comparisons are made against images with similar SSIM scores, but it is unclear if they indeed had similar qualities. And an ideal perceptual metric is not enough, specifics on "taking the AVIF format points as a basis and comparing them with the similarity and similar ratio points" would be necessary to evaluate the test.

[1] For example you can skip `free` on complicated structures because they will be reclaimed by the kernel anyway. Of course this is totally unacceptable for libraries.

[2] https://twitter.com/jonsneyers/status/1560924579719258113 (The ideal metric should strongly correlate to the human score and should not distort the relative score difference. Most metrics---except for SSIMULACRA 2 which specifically being developed with this dataset---are bad at both.)

Re:First automatic JPEG-XL cloud service by charcircuit on Wednesday September 20, 2023 @02:19AM (#37580972)
For other platforms it should check to see if it's more efficient to serve a JPEGXL WASM polyfill
Re:First automatic JPEG-XL cloud service by Scaevolus on Wednesday September 20, 2023 @03:32AM (#37581441)
Writing a good polyfill for this is harder than you might think, because the browser by default does lazy decoding of JPEG images to avoid holding too many buffers in RAM. Naive attempts (niutech/jxl.js) at JXL polyfills tend to crash browser tabs by using too much memory if they contain a few dozen megapixels of images, while Chrome normally can handle hundreds of megapixels of JPEGs on a page without difficulty.
Re:First automatic JPEG-XL cloud service by youngtaff on Wednesday September 20, 2023 @04:50AM (#37581959)
Relying on a polyfill means the browsers preloader won’t fetch the image early

Can add an explicit preload hint but it’s additional complexity

Re:First automatic JPEG-XL cloud service by supermatt on Wednesday September 20, 2023 @03:21AM (#37581362)
> JPEG-XL is newest image format and Gumlet is first cloud provider to support it.

This is completely untrue. Cloudinary have supported it since 2020, which is where Jon Sneyers, the chair for the JPEG XL WG and lead developer of libjxl works.

Shame on you for making false claims - especially considering your "service" is in direct competition to cloudinary.

Re:First automatic JPEG-XL cloud service by blurred on Wednesday September 20, 2023 @03:28AM (#37581413)
Also nearly all Apple devices should now be able to also convert JPEG-XL: https://www.theregister.com/2023/06/07/apple_safari_jpeg_xl/

>Google snubbed JPEG XL so of course Apple now supports it in Safari

Re:First automatic JPEG-XL cloud service by pmarreck on Thursday September 21, 2023 @02:43PM (#37602115)
The iPhone has something like an 87% market-dominating position with teens. Every single one has Safari preinstalled.

The "hedge" angle on doing what google isn't doing is a fascinating possibility.

Could it be that, paradoxically, Google actually inadvertently secured JPEG-XL's future by ripping it out of Chrome?

Re:First automatic JPEG-XL cloud service by adityapatadia on Wednesday September 20, 2023 @04:02AM (#37581651)
Founder here. We are first cloud service to do it "automatically" based on client support. Most services don't have this and those who have it, don't do it automatically and requires code change.
Re:First automatic JPEG-XL cloud service by supermatt on Wednesday September 20, 2023 @04:05AM (#37581667)
That is exactly what cloudinary does as part of their optimized delivery.

https://cloudinary.com/documentation/image_optimization#auto...

Re:First automatic JPEG-XL cloud service by adityapatadia on Wednesday September 20, 2023 @04:21AM (#37581771)
It still needs `f_jxl` in parameter. Automatic support has still not launched as per this article's last paragraph: https://cloudinary.com/blog/jpeg-xl-how-it-started-how-its-g...
Re:First automatic JPEG-XL cloud service by supermatt on Wednesday September 20, 2023 @04:36AM (#37581872)
The "automatic support" you mention there is for the AI optimization, which decides which format to use based on the image content. It is unrelated to the client detection.

You dont need to use the f_jxl parameter. e.g. https://res.cloudinary.com/demo/image/upload/c_scale,w_500/f...

Re:First automatic JPEG-XL cloud service by brycewray on Wednesday September 20, 2023 @06:20AM (#37582480)
Cloudinary is providing it now but, for the moment, you have to request that it be added when you use the `f_auto` ("auto format") transformation.
Re:First automatic JPEG-XL cloud service by ddalessa on Wednesday September 20, 2023 @09:26PM (#37592212)
Probably never heard of them, but https://www.peakhour.io have had automatic support for it based on the accepts header for about a year.
Re:First automatic JPEG-XL cloud service by supermatt on Sunday September 24, 2023 @03:44AM (#37630966)
It seems the poster isn't interested. I just checked in to see if they had "corrected" their article, and it seems not :(
Re:First automatic JPEG-XL cloud service by martin_a on Wednesday September 20, 2023 @03:34AM (#37581459)
Now... Do we need JPEG-XL in the first place? What's the benefit? Hardware is fast enough to decode JPEG, also storage is cheap enough to stick to JPEG. What's the point in using JPEG-XL if you're not running an imageboard or whatnot?!

edit: Happy Birthday, JPEG! We also got 30 years of integration, optimization and everything else for that image format, too.

Re:First automatic JPEG-XL cloud service by supermatt on Wednesday September 20, 2023 @03:37AM (#37581480)
High quality progressive decoding at reduced filesizes is a big positive for me. There is no other format that supports that.

https://www.youtube.com/watch?v=UphN1_7nP8U

Re:First automatic JPEG-XL cloud service by martin_a on Wednesday September 20, 2023 @03:43AM (#37581514)
Ok, that looks better than Progressive JPEG, I'll give you that. ;-)

On the other hand: When your connection speed is 30 kb/s, images are probably the last problem with "modern" websites... ;-)

Re:First automatic JPEG-XL cloud service by supermatt on Wednesday September 20, 2023 @03:55AM (#37581593)
Oh yeah, definitely. For me the usecase is infinite scrolling, where you buffering offscreen images to allow you to continually flick through an image feed without having to "wait" for a preview to appear. Although you can do this without JXL, its a much more fluid experience with the progressive download - especially if you micromanage the behaviour of the network requests (i.e. progressive throttling of offscreen images past first frame). Lower filesize over JPEG is also a benefit there as you can more quickly resume the load of the higher fidelity frames when in view.

Current browser support where available is a lot more restrictive TBH, as you dont have any control over that behaviour. But outside the browser its solid gold.

Re:First automatic JPEG-XL cloud service by KronisLV on Wednesday September 20, 2023 @06:19AM (#37582469)
> High quality progressive decoding at reduced filesizes is a big positive for me.

This is really cool!

Honestly, I want to use regular progressive JPEGs for a current project of mine, but it seems that even that doesn't have support in all the tech stacks yet despite how long it's been around for, for example: https://github.com/SixLabors/ImageSharp/issues/449

Here's hoping that in the case of JPEG-XL this will be more commonplace! In combination with loading="lazy", it would surely make the experience of scrolling through modern sites with lots of content a bit less data intensive.

Re:First automatic JPEG-XL cloud service by supermatt on Wednesday September 20, 2023 @07:14AM (#37582778)
yeah, you are very much at the mercy of the libs you use if you want full feature parity with, for example, libjpeg-turbo in the case of JPEG.

In the browser where supported, I guess loading="lazy" probably already works (i havent tried). I think a more advanced version where you can choose maybe a "staged" loading type, or some mechanism to choose the pass/frame to pause the network activity at so that you can control it further via JS would be nice. At a minimum it would be a feature enabling a preview and a reduced download for the full version. I can see many usecases where that could be useful.

Re:First automatic JPEG-XL cloud service by xena on Wednesday September 20, 2023 @03:37AM (#37581483)
The biggest advantage I can think about is transparency support.
Re:First automatic JPEG-XL cloud service by martin_a on Wednesday September 20, 2023 @03:40AM (#37581496)
Ok, but we got PNG for that. Photos usually don't contain transparencies, so why have several Megapixel/Megabyte large PNGs?
Re:First automatic JPEG-XL cloud service by xena on Wednesday September 20, 2023 @03:55AM (#37581590)
Because JPEG XL has smaller file sizes, which saves you money in the era of Managed NAT Gateway's 7 cents per gigabyte egressed.
Re:First automatic JPEG-XL cloud service by baq on Wednesday September 20, 2023 @05:40AM (#37582251)
Why not have one format good for everything image? There's zero reason to not have it now. Would you say 'We got GIF for that' if asked for animation?
Re:First automatic JPEG-XL cloud service by pmarreck on Thursday September 21, 2023 @02:45PM (#37602135)
I think animation is also part of the JXL spec, although may not be part of the reference implementation yet =)
Re:First automatic JPEG-XL cloud service by a-french-anon on Wednesday September 20, 2023 @05:10AM (#37582090)
Don't ignore the fact that unlike WebP (lossless: missing grayscale | lossy: forced 4:2:0 chroma subsampling =x | both: missing metadata and progressive) and AVIF (lossless: worse than PNG in many cases, i.e. useless), it's both a very good PNG and JPEG replacement; only AVIF wins in my books are very low bpp lossy quality (not very interesting), hardware decoding support and dav1d being amazing.

I seriously see JXL as a "keep it for 50 years" codec to replace our aging tech.

Re:First automatic JPEG-XL cloud service by JyrkiAlakuijala on Wednesday September 20, 2023 @01:29PM (#37587051)
WebP lossless as a format has two or three efficient ways of encoding grayscale (subtract green mode, palette, perhaps cross color decorrelation would work, too). Perhaps the libwebp APIs don't make it obvious. Density should be quite a bit better than with PNG.
Re:First automatic JPEG-XL cloud service by a-french-anon on Thursday September 21, 2023 @03:22AM (#37594271)
Indeed, that wasn't obvious it was using tricks to improve the situation. But I do remember in my tests PNG beating Webp when using gray8 input.

I mean, Webp must store an RGBA tuple for each pixel, even for grayscale without alpha, right?

Re:First automatic JPEG-XL cloud service by xena on Wednesday September 20, 2023 @03:35AM (#37581467)
Does anyone know of a Go library for encoding JPEG-XL files?
Re:First automatic JPEG-XL cloud service by adityapatadia on Wednesday September 20, 2023 @04:11AM (#37581714)
If you are curious, here is how JPEG-XL adoption looks like after 42 hours of iOS 17 launch: https://twitter.com/adityapatadia/status/1704407864326939043
Re:First automatic JPEG-XL cloud service by sonar_un on Wednesday September 20, 2023 @04:45AM (#37581926)
IOS 17 also added HEIF/HEIC support to their browers, which IMO, is HUGE.
Re:First automatic JPEG-XL cloud service by adityapatadia on Wednesday September 20, 2023 @07:18AM (#37582811)
We also support HEIF conversion with `format=heif` parameter. It's not automatic though.
Re:First automatic JPEG-XL cloud service by heykoo on Wednesday September 20, 2023 @08:09AM (#37583194)
And HEIF are automatically converted to JXL for iOS 17?
Re:First automatic JPEG-XL cloud service by adityapatadia on Wednesday September 20, 2023 @11:07AM (#37585162)
Yes!
Re:First automatic JPEG-XL cloud service by heykoo on Wednesday September 20, 2023 @11:58AM (#37585814)
I’m not clear on the benefit of doing that. Won’t you end up with worse quality from the transcode and have equivalent file size?
Re:First automatic JPEG-XL cloud service by adityapatadia on Wednesday September 20, 2023 @10:50PM (#37592691)
Do give it a try! In our tests we found that sizes are smaller and encoding of HEIF takes very very long time. Remember, we provide bunch of other things like image resize and crop etc so we always end up encoding image again. Encoding in HEIF is very slow.
Re:First automatic JPEG-XL cloud service by q87b on Wednesday September 20, 2023 @05:26AM (#37582190)
What does that show? Adoption where? By whom?
Re:First automatic JPEG-XL cloud service by pilif on Wednesday September 20, 2023 @05:49AM (#37582298)
I guess adoption of browsers capable of displaying JPEG-XL as part of the overall browser landscape
Re:First automatic JPEG-XL cloud service by adityapatadia on Wednesday September 20, 2023 @07:17AM (#37582804)
Out of total requests we have served in last 1 minute, this was percent of response was JPEG-XL. This is across all of our customer base.
Re:First automatic JPEG-XL cloud service by robertlagrant on Wednesday September 20, 2023 @04:16AM (#37581736)
Any insight on why Firefox and Chrome dropped it, other than how disappointing it felt? What was their reason?
Re:First automatic JPEG-XL cloud service by ZeroGravitas on Wednesday September 20, 2023 @04:41AM (#37581903)
For Google, focusing on one next gen image codec is the basic reason.

A perfectly reasonable decision if made by a committee of disinterested parties deciding the future of the web for the benefit of humanity, but a bad look when pulled by a megacorp.

For Firefox, it's about hoping to get to that latter situation. They want the web to move forward in step as much as possible rather than it being some wild west where everyone just does their own thing. They've lived through that already. And it sucked. Hence the various standardisation and community interoperability measures which have radically improved the web platform over the last decade or so.

Re:First automatic JPEG-XL cloud service by sonar_un on Wednesday September 20, 2023 @04:44AM (#37581920)
From what I remember, Firefox was basically neutral on it, and didn't want to extend resources to it if it wasn't adopted at wide scale. Chrome basically said that there wasn't much interest so they weren't going to put resources towards it.
Re:First automatic JPEG-XL cloud service by cjpearson on Wednesday September 20, 2023 @04:46AM (#37581937)
Unless something changed recently, Firefox never dropped support. It's always been behind a feature flag though. Google gave some reasons on their issue tracker.

https://bugs.chromium.org/p/chromium/issues/detail?id=117805...

Re:First automatic JPEG-XL cloud service by a-french-anon on Wednesday September 20, 2023 @05:04AM (#37582040)
Might have to do with https://flak.tedunangst.com/post/on-building-jpeg-xl-for-was... libjxl being a big C++ pain to build and maybe needing some serious audit/fuzzing. Still, AVIF isn't that much better except libavif being C (libheif is C++ though, and it's probably what's in use).
Re:First automatic JPEG-XL cloud service by MrAlex94 on Wednesday September 20, 2023 @05:21AM (#37582154)
Firefox still supports it - there are even pending patches for animation support. Unless it has recently changed, it’s only available on nightly builds + a preference toggle.

I pulled all the patches in to Waterfox and have had full support for JPEG XL for nearly a year now.

Re:First automatic JPEG-XL cloud service by obrhoff on Wednesday September 20, 2023 @04:55AM (#37581984)
Preview.app in Sonoma also supports now JPEGXL. Its also part of the Exportoptions.
Re:First automatic JPEG-XL cloud service by preya2k on Wednesday September 20, 2023 @05:05AM (#37582049)
JPEG-XL is a fantastic format but it has a big marketing/naming problem. I think the the lack of popularity/adoption is in big parts due to the confusing name.
Re:First automatic JPEG-XL cloud service by ElectricalUnion on Wednesday September 20, 2023 @02:09PM (#37587663)
It sucks that there are several other combinations of 2 letters suffixes that are also taken:

JPEG XR (Windows Media Photo, hdr), JPEG XS (a "realtime" one) and JPEG XT (a "very backwards compatible" one). So besides XL I'm never sure what the hell I'm dealing with.

Re:First automatic JPEG-XL cloud service by ksec on Thursday September 21, 2023 @10:23AM (#37598074)
Unfortunately the authors don't think that is the case. I pointed this out in 2019 / 2020 already.
Re:First automatic JPEG-XL cloud service by pmarreck on Thursday September 21, 2023 @02:39PM (#37602052)
I've never been confused about it, not sure what the issue is. There's JPEG, and there's JPEG XL.

Perhaps they should have called it JPEG 2.0.

Re:First automatic JPEG-XL cloud service by aspyct on Wednesday September 20, 2023 @06:04AM (#37582381)
Can't wait for my cameras to output jpgxl files natively!

It's probably at least 5 years away though...