News for hackers. Stuff that matters.
Re:Is WebP really better than JPEG? by moring on Tuesday June 23, 2020 @12:48PM (#23616500)
If transparency was the main issue, adding transparency to JPEG sounds easier than coming up with a completely new encoding, especially a lossy one.
Re:Is WebP really better than JPEG? by TylerE on Tuesday June 23, 2020 @01:07PM (#23616868)
How? Do you know how many binaries link to some old version of libjpeg? You're breaking 99.9% of the world and 80% of it is stuff that can't even be recompiled, probably.

In fact, JPEG 2000, which was standardized, in, well, 2000, already has transparency support, and 20 years later still have no meaningful support.

Re:Is WebP really better than JPEG? by moring on Tuesday June 23, 2020 @01:35PM (#23617326)
All that is true for WebP too, isn't it? If you cannot recompile a piece of software, how are you going to add WebP support to it?

And you aren't breaking it. In a theoretical world where transparency got added to JPEG, software that doesn't support it will show a fully opaque JPEG (adding transparency in a backwards compatible way isn't rocket science). Compare that to using WebP instead, where software that can't handle it won't even show the image.

Re:Is WebP really better than JPEG? by shuntress on Tuesday June 23, 2020 @04:56PM (#23620140)
It's not too unreasonable to assume that a given ancient program would have logic to differentiate between "This is a jpg and I know what to do with it" and "this is a something else and I don't know what to do with it" so it will technically handle webp images safely while it may not safely handle something that claims to be a jpg but apparently is not.
Re:Is WebP really better than JPEG? by pornel on Tuesday June 23, 2020 @06:18PM (#23621082)
> In a theoretical world where transparency got added to JPEG

It's not theoretical. It's the JPEG XT spec. It adds alpha channel and HDR to standard JPEG in a backwards-compatible manner.

Re:Is WebP really better than JPEG? by danudey on Wednesday June 24, 2020 @02:02PM (#23631551)
You offer two versions:

* A webp version with transparency, which won't be supported by most clients but the ones which do will support everything

* A JPEG version without transparency, or with "faked" transparency (i.e. baked-in background color), which will be supported by basically everyone but with less quality.

That way, if the client is capable of loading the "good" version it will, and if it can't then it will load the "good enough" version.

Re:Is WebP really better than JPEG? by TylerE on Tuesday June 23, 2020 @03:26PM (#23618969)
You don't have 15 year old binaries linking against an 18 year old version of libwebp.
Re:Is WebP really better than JPEG? by wizzwizz4 on Tuesday June 23, 2020 @03:42PM (#23619225)
No; you just have no compatibility whatsoever.
Re:Is WebP really better than JPEG? by leni536 on Tuesday June 23, 2020 @02:07PM (#23617823)
On the web you can do it with SVG.

https://github.com/leni536/trans_jpg

Re:Is WebP really better than JPEG? by pseudosavant on Tuesday June 23, 2020 @04:40PM (#23619935)
That is really cool. I had never thought about (ab)using SVG in that way.

SVG is such an underappreciated technology that is in every browser. Why do icon fonts exist when you could just use SVGs just like you do PNGs and JPEGs? You can even inline them in your HTML so there isn't an additional HTTP request if you want.

Re:Is WebP really better than JPEG? by coopsmgoops on Tuesday June 23, 2020 @06:58PM (#23621439)
Wouldn't it probably be one request per icon instead of just one request for a while font?
Re:Is WebP really better than JPEG? by pikelet on Tuesday June 23, 2020 @08:52PM (#23622586)
Not necessarily. You can have a single SVG file with multiple 'defs' that you can reference around the page, or just embed the SVG code in the HTML itself (via a templating language) if you're not using too many.
Re:Is WebP really better than JPEG? by cmroanirgo on Tuesday June 23, 2020 @05:51PM (#23620807)
Great idea, I love 'thinking outside the box' solutions, but doesn't seem to work on Firefox mobile. (Perhaps it's just me.)
Re:Is WebP really better than JPEG? by rndgermandude on Tuesday June 23, 2020 @01:37PM (#23617359)
Because JPEG 2000 was essentially a patent-covered mess that nobody wanted to touch
Re:Is WebP really better than JPEG? by jandrese on Tuesday June 23, 2020 @03:04PM (#23618637)
Shouldn't those patents be expiring soon?

Edit: Did some more research and the patent risk appears to have passed as of 2016. Still nobody seems to have interest in JPEG2000.

Re:Is WebP really better than JPEG? by rndgermandude on Tuesday June 23, 2020 @09:41PM (#23622952)
webp was around since 2010 and has google's backing. Microsoft tried their own thing (Jpeg XR; 2009) and the actual JPEG committee announced their work Jpeg XL (with google backing) a while ago, while Apple switched to HEIC/HEIF as of 2017 (HEIC is like webp just based on HEVC aka H.265 instead of vp8 i-frames; and it's a patent mess of course).

There is simply no reason why people in 2016 or now would be interested in a format from 2000 that was a patent minefield until at least 2016.

Re:Is WebP really better than JPEG? by jandrese on Thursday June 25, 2020 @03:24PM (#23644472)
Except for JPEG the alternatives are also patent minefields...

Are people just more cavalier about the patent risk these days? The problem with JPEG2000 wasn't the patents we knew about, it was the possibility of submarine patents. People were still wary after the GIF debacle. Nobody wanted to be charged $0.05/image after the fact when they've delivered literally billions of images. Plus the courts were seen as very favorable towards patent holders, even when they were acting in bad faith.

Re:Is WebP really better than JPEG? by duaoebg on Tuesday June 23, 2020 @03:55PM (#23619397)
It’s too compute intensive
Re:Is WebP really better than JPEG? by jandrese on Tuesday June 23, 2020 @04:05PM (#23619525)
That's kind of scary for something developed in the 90s. It was originally run on Pentiums, K6s, PPC 604s, and the like and it's still too expensive for a Ryzen 7?
Re:Is WebP really better than JPEG? by willglynn on Tuesday June 23, 2020 @04:31PM (#23619821)
Yep. There's a ton of data dependencies, where e.g. you can't begin decoding the next bit until you've finished decoding the current bit. It's all about progressive decoding so there's multiple passes over each group of wavelet coefficients, accessed in a data-dependent sequence. Each wavelet transform involves accessing and interleaving the same 2D arrays in both row- and column-oriented fashions.

These design decisions all made sense when clock rates were exponentiating, but they're all nightmares now that we rely on branch prediction and memory prefetching and superscalar execution units. The codec is simply not a good fit for the computing architectures we have today.

Re:Is WebP really better than JPEG? by blattimwind on Tuesday June 23, 2020 @05:16PM (#23620411)
> These design decisions all made sense when clock rates were exponentiating, but they're all nightmares now that we rely on branch prediction and memory prefetching and superscalar execution units. The codec is simply not a good fit for the computing architectures we have today.

Arguably not a good choice for the year 2000, either, considering that all high performance CPUs at that time were out-of-order, superscalar and deeply pipelined.

Re:Is WebP really better than JPEG? by duaoebg on Tuesday June 23, 2020 @04:22PM (#23619731)
Images got bigger... it’s not that it’s too expensive it’s just way more expensive that good enough alternatives. There are other reasons too but that’s a surprising one
Re:Is WebP really better than JPEG? by gsich on Tuesday June 23, 2020 @07:53PM (#23621997)
No.
Re:Is WebP really better than JPEG? by lozf on Tuesday June 23, 2020 @05:29PM (#23620565)
AFAIK it's pretty standard in DCP files for Digital Cinema.
Re:Is WebP really better than JPEG? by acdha on Tuesday June 23, 2020 @05:24PM (#23620504)
That was a little of it but the patents expired years ago. The big blockers I saw were basically that it was a very complex format with a specification behind a paywall and no good open-source implementation or test suite. Interoperability was bad until a couple of years ago and it took significant amounts of complex code to make it fast enough to use.

They've subsequently improved that — OpenJPEG is quite good now https://github.com/uclouvain/openjpeg — but probably missed the window for adoption barring a major upset, which is a shame because it's a very powerful codec and has some neat tricks like progressive decoding (imagine if you could have one file in storage and your responsive design simplify specified the HTTP range requests to get for successively large resolution images?). You could ship it in a browser using WASM but I think the browsers are — not without cause — being really reluctant to add new formats and the ensuing security risks without a good reason, and without browser support no format will be more than a niche.

Re:Is WebP really better than JPEG? by alwillis on Tuesday June 23, 2020 @05:57PM (#23620870)
In fact, JPEG 2000, which was standardized, in, well, 2000, already has transparency support, and 20 years later still have no meaningful support.

Every iOS and macOS device supports JPEG 2000… that should be pretty meaningful.

Re:Is WebP really better than JPEG? by kbenson on Tuesday June 23, 2020 @06:02PM (#23620925)
That accounts for significantly less than half the whole market, and half the mobile and desktop markets if you split it out. If it's also supported by other OS's and headsets and browsers that bring it significantly closer to 100%, then maybe we have something meaningful.
Re:Is WebP really better than JPEG? by alwillis on Wednesday June 24, 2020 @06:08PM (#23634423)
Well, 2 billion devices is a meaningful number of devices, no matter how you slice it.
Re:Is WebP really better than JPEG? by kbenson on Wednesday June 24, 2020 @06:38PM (#23634658)
That's entirely dependent on context. In the context of "can I use this and expect it to work most the time" it's nowhere close enough. All that matters in that respect is percentage of the whole, and at less than half, it's not really much.

As an example, we could talk about the number of connected IoT devices that are supported and up to date, and it's probably in the billions. But compared to the number of connected out of date and unsupported devices, it's likely inconsequential in comparison by metrics of total numbers, percentage of a whole, and importance (alternatively, total number of unsupported and possible exploitable devices does matter, because of what it implies about how they can be used destructively).

Re:Is WebP really better than JPEG? by dvhh on Wednesday June 24, 2020 @01:15AM (#23624347)
Is there still some licensing issues with jpeg 2000?
Re:Is WebP really better than JPEG? by TylerE on Tuesday June 23, 2020 @05:59PM (#23620892)
Chrome and Firefox don't.
Re:Is WebP really better than JPEG? by jws on Tuesday June 23, 2020 @03:29PM (#23619029)
I did some proof-of-concepts ages ago (October 2010) exploring different ways of embedding a PNG alpha channel in JPEG application specific fields to have 100% JPEG compliant files which web browsers could display with transparency. It worked just fine.

If you want transparent JPEGs on your web page that works.

Back then the number of GETs was really important, so stuffing the mask into the JPEG made sense. Now with our HTTP/3 and QUIC world that isn't such a big deal.You might be better off just using a CSS mask image.

Re:Is WebP really better than JPEG? by agumonkey on Tuesday June 23, 2020 @01:04PM (#23616808)
clearly we need to dig in past work to find who tried that
Re:Is WebP really better than JPEG? by asjw on Tuesday June 23, 2020 @03:04PM (#23618645)
Flash could do it
Re:Is WebP really better than JPEG? by mehrdadn on Tuesday June 23, 2020 @04:38PM (#23619906)
I think the idea is "if you're going to break compatibility, might as well make all the improvements at once".