News for hackers. Stuff that matters.
Re:Is WebP really better than JPEG? by JimDabell on Tuesday June 23, 2020 @12:34PM (#23616308)
You can argue the toss over quality, but JPEG can't do transparency while WebP can. So if you need transparency, you need to compare the size savings to PNG, not JPEG. WebP is the clear winner there.
Re:Is WebP really better than JPEG? by surround on Tuesday June 23, 2020 @03:42PM (#23619224)
WebP also supports animation, which is important because GIFs are notoriously large.
Re:Is WebP really better than JPEG? by pornel on Tuesday June 23, 2020 @06:15PM (#23621047)
WebM (despite being closely related to WebP) can be 5-10x more efficient than WebP.

That's because WebP focused so strongly on being a GIF equivalent that it also dropped all things that made WebM efficient and instead adopted GIF's awfully inefficient architecture (just dumb frames overlaid on top of each other, without motion vectors or predicted frames).

Safari shows how it can be done: it supports silent MP4/H.264 straight in <img>. You get all the ease of use GIF, order of magnitude smaller file, and hardware acceleration.

It's unintuitive, but well-compressed videos are cheaper to decode than dumb "animation" formats, because file size differences are so massive that it's cheaper to decompress a small amount of complex data than to chew through vast amounts of poorly compressed data.

Re:Is WebP really better than JPEG? by catalogia on Tuesday June 23, 2020 @09:45PM (#23622978)
There's also the practical matter of network speed. In many common scenarios a 300kb webm can be fully downloaded and playing while a roughly equivalent 5mb gif is paused a few frames in, buffering.
Re:Is WebP really better than JPEG? by fomine3 on Tuesday June 23, 2020 @09:46PM (#23622991)
Also video decoding is cheaper because most GPU/SoCs supports hardware decoding.
Re:Is WebP really better than JPEG? by heavyset_go on Tuesday June 23, 2020 @10:03PM (#23623109)
This isn't a good assumption to make, many people own cheap phones that lack hardware codecs that can decode videos with modern encodings.
Re:Is WebP really better than JPEG? by fomine3 on Wednesday June 24, 2020 @01:24AM (#23624404)
I can't imagine any cheap SoC for smartphones without H.264 HW decoder because playing video is essential and it can record video. Possibly exists for low-feature phones without camera but it's not for web browsing.
Re:Is WebP really better than JPEG? by heavyset_go on Thursday June 25, 2020 @04:33PM (#23645357)
The licenses for codecs sometimes cut into the thin margins on budget phones. A large amount of people outside of the US and EU are stuck on low-end phones, and I'm pretty sure many of the government subsidized phones in the US are in the same boat.
Re:Is WebP really better than JPEG? by t0ughcritic on Wednesday June 24, 2020 @12:54AM (#23624251)
Do people really use Safari?
Re:Is WebP really better than JPEG? by bartread on Wednesday June 24, 2020 @02:03AM (#23624600)
Yes, lots of them... on iOS.

Also worth noting that all the alternative browsers on iOS are just reskinned versions of Safari as well.

Re:Is WebP really better than JPEG? by robin_reala on Wednesday June 24, 2020 @07:16AM (#23626583)
Somewhere between 25 and 50% globally based on your audience.
Re:Is WebP really better than JPEG? by crymer11 on Wednesday June 24, 2020 @01:15AM (#23624350)
Lots of folks using Mobile Safari.
Re:Is WebP really better than JPEG? by Andrex on Tuesday June 23, 2020 @04:43PM (#23619986)
As a point of data, Animated PNG is finally (as of ~2019) supported natively among all major browsers.

https://caniuse.com/#search=animated%20png

Edit- I was unaware the recently-announced Safari 14 Technical Preview adds support for WebP too! Making both formats viable for all browsers, finally.

Re:Is WebP really better than JPEG? by _AzMoo on Tuesday June 23, 2020 @06:59PM (#23621450)
Recently we've been going through the browser stats on our websites, and while globally apparently IE is dying, it's certainly not dead yet. In the specific industry I work in (Heavy Automotive Retailing, eg Truck Sales and Servicing), we see upwards of 30% of our users on browsers <= IE11. All of our sites are getting poor lighthouse scores on performance with the main suggestion to be changing to webp, but that would exclude 30% of our customers.
Re:Is WebP really better than JPEG? by amq on Wednesday June 24, 2020 @08:16AM (#23626988)
There is a way to offer both jpg and webp, letting the browser to choose.
Re:Is WebP really better than JPEG? by jjoonathan on Tuesday June 23, 2020 @05:14PM (#23620393)
Ooh, does that mean that slack supports WebP now?

Update: nope. Maybe another year :(

Re:Is WebP really better than JPEG? by arcticbull on Tuesday June 23, 2020 @04:15PM (#23619635)
Animations should just be videos. No reason for an animated image format, an animated image is just a video with no audio track.
Re:Is WebP really better than JPEG? by auxym on Tuesday June 23, 2020 @04:44PM (#23619998)
My understanding is that webp is video. That is, it's a still frame using the vp8 codec.
Re:Is WebP really better than JPEG? by TazeTSchnitzel on Tuesday June 23, 2020 @05:55PM (#23620850)
It only has VP8's intraframe compression, not VP8's interframe compression, so animated WebP is not a proper video codec and is a different beast to WebM video.
Re:Is WebP really better than JPEG? by catalogia on Tuesday June 23, 2020 @05:45PM (#23620736)
As far as I can tell though, it has to be VP8 and can't be VP9. Maybe I'm mistaken about that, but all the webp literature I've read or skimmed talks about VP8 specifically. So what's the advantage of an animated webp using VP8 over a webm using VP9?
Re:Is WebP really better than JPEG? by thinkloop on Tuesday June 23, 2020 @09:59PM (#23623068)
No need for image formats either as an image is just a very short single frame video.
Re:Is WebP really better than JPEG? by basilgohar on Tuesday June 23, 2020 @10:19PM (#23623219)
I think this a very poor comparison to make because it denies the time dimension of video completely, which fundamentally affects how we perceive and use video, and also ignores the fact that still images linger and have different requirements.
Re:Is WebP really better than JPEG? by coopsmgoops on Tuesday June 23, 2020 @06:52PM (#23621395)
The only advantage I can see it where videos are not allowed to autoplay you would want a gif to play somethig small.
Re:Is WebP really better than JPEG? by ehsankia on Wednesday June 24, 2020 @02:45PM (#23632157)
For me is all about sharing. The website itself usually displays the "video" as if it was a gif, but as soon as you go to share anywhere, you're sharing a video on platforms that handle it like a video. No looping, seek controls, complicated UI, etc. I just want to post a photo that auto plays and loops anywhere. I don't are about the internals, but I want all applications to recognize that file as an animated photo, not a video.
Re:Is WebP really better than JPEG? by spartanatreyu on Tuesday June 23, 2020 @07:19PM (#23621652)
Videos can autoplay on browsers if they are muted
Re:Is WebP really better than JPEG? by dtech on Tuesday June 23, 2020 @04:48PM (#23620047)
An animated WebP is basically a WebM video.

Or let me rephrase, why is WebP as a animated picture / video format insufficient?

Re:Is WebP really better than JPEG? by sk65535 on Tuesday June 23, 2020 @05:46PM (#23620751)
video format usually take up too much memory: what you gain in efficiency costs in resources. Conversely, animated WebP are dirt cheap: one buffer only, written over and over.

Then, there's optim being made in WebP to allow fast jump to keyframe, even when there's transparency. Video codec don't allow that, and you can have an arbitrary long torture sequence of transparent frame that needs to be decoded back when the video comes in the view again.

Last, animation are usually low-fps (~10fps): there, video codec don't perform very well and are basically keyframes. So the difference isn't as great as one would think.

Oh, and hardware need a 'reset' between decoding tasks, to reconfigure memory, and decoding can't be parallelized.

Re:Is WebP really better than JPEG? by bobbylarrybobby on Tuesday June 23, 2020 @05:40PM (#23620687)
Eh. An animated image (an image that contains some sort of video media, whether gif or h264 or whatever) is a hint to the browser to play it automatically and without sound. If everything were true video (say, mp4) you couldn’t make that distinction. As long as the video in the animated video is encoded properly — as real video and not a sequence of frames as gif does — then animated images definitely have their places.
Re:Is WebP really better than JPEG? by JoshTriplett on Tuesday June 23, 2020 @05:58PM (#23620885)
> An animated image (an image that contains some sort of video media, whether gif or h264 or whatever) is a hint to the browser to play it automatically and without sound. If everything were true video (say, mp4) you couldn’t make that distinction.

<video autoplay muted> says the same thing.

Re:Is WebP really better than JPEG? by sprokolopolis on Tuesday June 23, 2020 @04:05PM (#23619530)
Also, gif only supports one-bit transparency; Whereas webp and png allow partial/gradated transparency.
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".
Re:Is WebP really better than JPEG? by waheoo on Tuesday June 23, 2020 @10:31PM (#23623308)
Do you though? The transparent png use case is largely being replaced by svg.

There are some situations where transparency is legitimately needed but im not sold it can justify webp and all that comes with it.

Re:Is WebP really better than JPEG? by httpsterio on Tuesday June 23, 2020 @10:52PM (#23623473)
vector graphics and raster graphics aren't really comparable.
Re:Is WebP really better than JPEG? by waheoo on Tuesday June 23, 2020 @11:53PM (#23623896)
Why not?

They display an image. Bit if a weak argument to say they dont matter when theyre being used to create the same final outcome.

Re:Is WebP really better than JPEG? by httpsterio on Wednesday June 24, 2020 @12:32AM (#23624117)
How would you show a photographed image as a svg? Either you would have to "vectorize" the image which would look totally different or you'd create a grid of vectors with different hue values, ultimately representing pixels in an extremely inefficient format.

Raster graphics and vector graphics can't be compared because sure, you could create 2 million vector squares with individual positions, sizes and colors and align it into a 16:9 grid or you could just use a jpg. The latter being a fraction of the size and processing power needed to display it.

Re:Is WebP really better than JPEG? by waheoo on Wednesday June 24, 2020 @08:16AM (#23626991)
Why would you show a photograph as an svg? You wouldnt. Thats what jpegs are for.

We're discussing transparency and the use case for it. I dont think ive ever heard of someone wanting transparency in a photo. The only times i see the need is if theyre doing something that is better off in a vector format. I.e. png, which is being supplanted by svg, which alleviates the size problems raised about pngs.

I.e. webp is a format solution in search of a problem.

Downvoted, wow, petty.

Re:Is WebP really better than JPEG? by 013 on Wednesday June 24, 2020 @11:38AM (#23629181)
>I dont think ive ever heard of someone wanting transparency in a photo.

OK, but they do. It's pretty common for someone to cut out an object in a photo and have a transparent background.

Re:Is WebP really better than JPEG? by romwell on Tuesday June 23, 2020 @10:03PM (#23623106)
>JPEG can't do transparency

JPEG "can't" do depth maps either, and yet it manages to do them just fine.

"Portrait mode" on Android is simply JPEG + greyscale JPEG embedded in metadata.

If anyone really wanted transparency, it is very easy to add it to JPEG.

That said, in practice, transparency is not needed in non-vector / non-generated graphics formats. The nature doesn't really have an alpha channel, photographs certainly do not.

Transparency is extra information, and can be passed along as such.

Re:Is WebP really better than JPEG? by m45t3r on Tuesday June 23, 2020 @10:32PM (#23623318)
The problem is always standards. I want transparency to work correctly everywhere, not just in one application and broken everywhere else.

Even if transparency was add to JPEG right now, it would take sometime to become available everywhere, and you would have tons of legacy devices showing broken transparency.

The advantage of a new format that supports transparency from is interception is that every device that is compatible with it will display it correctly. So there is no issue with some devices supporting the format partially.

Re:Is WebP really better than JPEG? by romwell on Thursday June 25, 2020 @07:23PM (#23646923)
The larger picture is that you can use PNG or SVG anywhere you need transparency, which are also better suited for the content that has transparency.

JPEG is optimized for photos, which don't have transparent parts.

SVG and PNG are optimized for graphics.

So, if you need transparency, WEBP is probably not the format you'd choose anyway.

Re:Is WebP really better than JPEG? by m45t3r on Sunday June 28, 2020 @12:39PM (#23669999)
> The larger picture is that you can use PNG or SVG anywhere you need transparency, which are also better suited for the content that has transparency.

It is pretty common to have anime characters where you remove the background to use as reactions, and while you can use PNG in those cases it makes the images huge. WebP makes it ideal for those cases, this is even the case that I saw this being used in some image boards (specially also including animation, another thing that is popular).

Just because you can't think in a use case there isn't mean that there isn't a use case.