News for hackers. Stuff that matters.
Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by redox99 on Saturday March 18, 2023 @05:38PM (#35213353)
Mozilla and Google dropping JPEG-XL support because "too much complexity". Software engineers using "too much complexity" as an excuse for something they don't want to do is such a classic move.

Browsers are already absurdly complex, and are constantly receiving HTML, CSS and JS features that significantly increase complexity. Are we really to believe that adding support for a certain image format, which is basically as modular as it gets (decode the file into a buffer), is too much complexity?

Obviously, this is a case of them showing favoritism toward codecs based on the IP owners of those codecs.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by pedrovhb on Saturday March 18, 2023 @08:09PM (#35214547)
Not to mention the complexity is mostly offloaded to the maintainers of the library itself, not the browser that calls it.

I wish Mozilla had gone ahead and enabled it by default in Firefox, as I'd hoped it would. Still salty it didn't happen (yet, at least). It seems like such a clear choice to developers that there's actually people being vocal about it (as evidenced by the sparse but constant stream of e.g. posts on HN about browser image codecs, which is a topic _no one_ finds sexy otherwise), but browser vendors still won't budge. It's weird to see them say "sure it's better, but it's not better enough than the alternatives". There's a large enough discrepancy in my own perception of the merits of jxl and that of the people making choices for browsers that I genuinely wish I understood them, because it feels like I'm missing something.

I still convert my pictures to jxl locally and, and the space savings are enough of a reason to go through the trouble of converting - it just seems like a no-brainer that it'd be even more valuable on the web, as bandwidth savings are generally even more important than disk storage, and then there's still the plethora of other features on top of that.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by izacus on Sunday March 19, 2023 @02:47AM (#35216654)
The browser developers defacto become the library maintainers since they're now on the hook for any security issue within that library forever. Even if the "real" maintainers go play with something else.
Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by skywal_l on Sunday March 19, 2023 @03:35AM (#35216859)
Indeed, once you officially support a format and it becomes a standard, you have to support it forever. Sunsetting a feature is not that easy on the web. So if for some reason the maintainer of a library used by the browser drops the ball you are on the hook for anything. And decoding binary data coming from unknown potentially malicious source is full of potential security traps.
Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by toastal on Sunday March 19, 2023 @04:02PM (#35222953)
Considering <picture> and image() exists and should be seen as a best practice, adding and removing image formats/codecs should have a few less problems than some other libraries, no?
Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by eyelidlessness on Sunday March 19, 2023 @06:50PM (#35224544)
They provide some resilience, assuming their fallback usage includes multiple formats. Which isn’t a safe assumption, but even granting it, there are other problems with removing a codec. The most obvious being abruptly increasing the bandwidth requirements for all users of the removed codec.

Even if that bandwidth is “free”, it can be significant enough to prevent access by end users with slow/spotty connections. Depending on the use case, that can have the consequence of also basically obsoleting the site serving those users. Just as some innovations enable whole new use cases, reverting the innovation can have the opposite effect.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by pornel on Saturday March 18, 2023 @09:12PM (#35214938)
The attempt to provide a second JPEG-XL implementation has stalled. Two independent implementations are the bar for a web standard. AVIF meets it, JPEG-XL does not.

There has been enough 3rd party interest to create multiple AV1/AVIF implementations. JPEG-XL has its original team (doing great work), and then… commenters lamenting, but nobody else invested enough to actually to write the code.

Browsers' goal is not just to have every benchmark-winning format. They also need to minimize attack surface, risk of bug-compatibility (which is why one and only implementation is not sufficient), and watch out for long-term costs of code size, maintenance, and technical debt. New codecs can be added at any time, but can never be removed.

AV1 got in, because video really needed an answer to the looming threat of patented expensive H.265. There was a risk of repeating the pains of H.264 support, and this time without Cisco's licensing loophole. Then AVIF got in, because AV1 was already in. It's that simple.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by hypothesis on Saturday March 18, 2023 @09:30PM (#35215061)
This is just WebSQL story all over again, right? “Go redo it from scratch” is the most ridiculous excuse in the book.
Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by infogulch on Saturday March 18, 2023 @11:49PM (#35215854)
Except they made the right choice with WebSQL. Exposing and securing the entire api surface of sqlite -- from sql syntax to binary compatibility to behavior-altering pragmas -- would have been a compatibility and security nightmare that would make xkcd 1172 look tame by comparison. Exposing a block device instead [1] and layering user-provided sqlite on top of it via WASM [2] is infinitely better than rushing to lock ourselves into a roller coaster that runs straight through the worst compatibility minefield the web has ever seen.

[1]: https://news.ycombinator.com/item?id=35165640 "Firefox 111.0 enabled Origin private file system access"

[2]: https://news.ycombinator.com/item?id=33374402 "SQLite in the browser with WASM/JS"

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by peppermint_gum on Saturday March 18, 2023 @11:04PM (#35215592)
>The attempt to provide a second JPEG-XL implementation has stalled

What do you mean by "the attempt"? There are at least three independent decoder implementations:

jxl-oxide (Rust): https://github.com/tirr-c/jxl-oxide

J40 (C): https://github.com/lifthrasiir/j40

jxlatte (Java): https://github.com/thebombzen/jxlatte

None of them is feature complete, but it's because each of them is a hobby, single-person project. You're making it sound like some billion-dollar company tried to implement JPEG XL and failed, because it's too complex or something.

However, it should be noted that those independent implementations, despite being hobby projects, helped to iron-out some minor issues in the standard.

>Then AVIF got in, because AV1 was already in.

AVIF uses its own container format that had to be implemented. Implementing AV1 does not give you AVIF support for free.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by kstenerud on Saturday March 18, 2023 @11:38PM (#35215799)
> None of them is feature complete, but it's because each of them is a hobby, single-person project

Which is why they're not considered implementations to meet this bar. You need multiple FULL implementations to ensure that it is actually FULLY viable, otherwise you risk taking on a potentially broken format that you can't remove.

> You're making it sound like some billion-dollar company tried to implement JPEG XL and failed, because it's too complex or something.

I doubt any big company actually tried (or tried very hard). Cost of implementation becomes a kind of implicit test here, because companies like things cheap.

> AVIF uses its own container format that had to be implemented. Implementing AV1 does not give you AVIF support for free.

It gives AVIF support for cheap due to code/algorithm re-use. Companies like things cheap, so that's a big selling point.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by pornel on Sunday March 19, 2023 @12:01AM (#35215907)
To be fair, you don't need a FULL implementation. You just need some safe subset that everyone agreed on. For example, even the old JPEG was never fully implemented in browsers — arithmetic coding is not supported.
Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by prirun on Sunday March 19, 2023 @09:08AM (#35218560)
> I doubt any big company actually tried (or tried very hard). Cost of implementation becomes a kind of implicit test here, because companies like things cheap.

So if an individual unpaid volunteer spends their time doing a 2nd implementation, <bigco> might consider it for their browser. But they won't pay for a 2nd implementation with their own staff, even if they own a humongous chunk of the browser market (which comes with responsibilities) and even if it is a better algorithm.

Sounds about right.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by kstenerud on Monday March 20, 2023 @01:36AM (#35227685)
It's all about incentives. If there's enough incentive for them to do it, they will. "Better" doesn't always have much to do with it.

We make incremental gains as a human race, not necessarily optimal ones.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by infogulch on Saturday March 18, 2023 @11:29PM (#35215738)
The point of requiring a second implementation is to prove that the standard is stable and consistent enough that at least two of them can agree on how it works. It doesn't matter who is building the second implementation, it just needs to exist in a feature complete and maintained state. If hobbyist implementations have been uncovering issues in the standard, that just further justifies the "two independent implementations" rule. Bug-for-bug compatibility problems are browser vendors' worst nightmare.
Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by pornel on Saturday March 18, 2023 @11:50PM (#35215865)
I was thinking about j40.

It's cool that there's a Rust implementation in progress. If it works out, it will make it much easier for me to support JXL. I've been waiting to RIIR the j40 instead.

AVIF (HEIF) container format is MP4, which browsers already parse for video. There is a bit of extra work to extract image-specific data, but it's minor compared to AV1 implementation. AVIF even contains a completely redundant copy of key AV1 metadata (av1C) to spare implementations from parsing the AV1 payload.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by timoteostewart on Sunday March 19, 2023 @03:40AM (#35216882)
RIIR = rewrite it in Rust
Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by jonsneyers on Sunday March 19, 2023 @05:24AM (#35217358)
The number of implementations was not considered a criterion for Chrome, or at least they didn't mention it. For WebP, they didn't seem to care much about it. I agree that it's a good criterion, as it is a good way to ensure that a spec is solid and interoperability actually works. So I am happy that there are currently three alternative jxl implementations.

The main thing you want to have though, is a standard that cannot be unilaterally changed in arbitrary ways by a single party. However flawed it may be, ISO does have a long history of standardization, and it has procedures in place to ensure that changes are scrutinized and can only be applied when approved by the national standardization bodies.

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by pornel on Sunday March 19, 2023 @06:40PM (#35224457)
Yeah, WebP was forced on other browsers, and never met the bar for a proper standard.
Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by ksec on Sunday March 19, 2023 @02:51AM (#35216667)
>Obviously, this is a case of them showing favoritism toward codecs based on the IP owners of those codecs.

I am sorry it is hard for me to not take a jab at this considering their codec is patent free so their should be zero IP owners. /s

Anyway JPEG XL is a miniture project physically. A compressed wasm binary is around 175 kB. I don't think complexity is an issue there. [1]

[1] https://twitter.com/jyzg/status/1633504595094773765

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by scorpio241 on Sunday March 19, 2023 @03:10AM (#35216749)
This is a battle for future default image codec: open standard vs nearly proprietary controlled by a few corporations - https://en.wikipedia.org/wiki/Alliance_for_Open_Media : > The governing members of the Alliance for Open Media are Amazon, Apple, ARM, Cisco, Facebook, Google, Huawei, Intel, Microsoft, Mozilla, Netflix, Nvidia, Samsung Electronics and Tencent.

For example with defensive license termination: they can sue you, but if you try to sue them you have to rip off AVIF from all your products: https://aomedia.org/license/patent-license/

>Defensive Termination. If any Licensee, its Affiliates, or its agents initiates patent litigation or files, maintains, or voluntarily participates in a lawsuit against another entity or any person asserting that any Implementation infringes Necessary Claims, any patent licenses granted under this License directly to the Licensee are immediately terminated as of the date of the initiation of action unless 1) that suit was in response to a corresponding suit regarding an Implementation first brought against an initiating entity, or 2) that suit was brought to enforce the terms of this License (including intervention in a third-party action by a Licensee).

Re:JPEG-XL vs. AVIF and Others: 27 Images Compared by jonsneyers on Sunday March 19, 2023 @04:11AM (#35217001)
Defensive license termination is actually a good thing. It is how you can keep a codec royalty-free. Without defensive termination, it is way too easy in the current patent system for patent trolls to make bogus claims and bully companies into paying them royalties. JPEG XL also has defensive termination clauses, and so do the Apache 2.0 and GPL v3 FOSS licenses.

AOM has noble goals: royalty-free codecs for the web. JXL is also a royalty-free codec that is very well suited for the web (as well as many other use cases for still images). There is no reason why we can't just have both supported by browsers.