424 points · by kasabali · 6y ago · 310 comments
Even if the above were just an individual... bafflement? and not an actual issue, the size savings really don't seem worth the compatibility hassle, the extra manpower/workflow complexity to support 2 formats, the additional storage (and caching) caused by this duplication.
And the above is if it's done RIGHT. 80% of people outside this forum won't understand that you're not supposed to convert from a lossy format to another, and just convert jpegs to webp.
Webp seems so pointless. A progressive jpeg with an optimized Huffman table can be understood by a 27 year old decoder without issues, achieves 90% of the quality/size claims of webp and can be produced losslessly from your source jpegs. This is without even touching Arithmetic Coding (also lossless, part of the official standard, but poorly supported due to some software patents, even though they all expired by now), or playing with customized DCT quantization matrices to get more compressible outputs (incurs a generation loss, but produces standard files).
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.
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.
In fact, JPEG 2000, which was standardized, in, well, 2000, already has transparency support, and 20 years later still have no meaningful support.
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.
There are some situations where transparency is legitimately needed but im not sold it can justify webp and all that comes with it.
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.
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.
Not only does the best JPEG encoder perform as good if not better than the best WebP encoder. With a JPEG Repacker [1] JPEG file size could easily be 20% smaller. If you have to support a new format with relatively little benefits, why not just support using the repacked instead.
You'll probably know this already, but Brunsli made it into the JPEG XL standard. I'm quite happy about it!
[1] https://en.wikipedia.org/wiki/Joint_Photographic_Experts_Gro...
TL;DR: We're now at "Draft International Standard" stage; soon we'll enter "Final Draft International Standard" stage and at that point the bitstream is effectively frozen and adoption can start. The officially ISO-published International Standard will take until first half of 2021, but the codec should be ready to use before that.
Its only appeal is that it's royalty-free, but since all devices that support VP9 decoding also support h.264, is it really worth it?
MP3 is competitive with AAC and far more compatible, if you use LAME. Same with JPEG and WebP, or x264 and VP9. All 3 of those encoders deliver higher quality AND better encoding speed than their competitors.
Switch encoders before you switch formats.
There exist other VP9 encoders, but all for specialized purposes.
AFAIK they don't? They use some of the metrics which are provided in Lighthouse (Largest Contentful Paint, First Input Delay, Cumulative Layout Shift) all play a role in ranking, but the score itself is meaningless.
Could you share your comparisons? From the ones I've seen, it looks like WebP significantly outperforms JPEG encoders[0].
[0]: https://wyohknott.github.io/image-formats-comparison/#endeav...
So the only place they can target is where JPEG starts to break down: When you've cranked the quality knob down to 20 and you're seeing macroblocks and other artifacts in the image. But this is a niche use case as network speeds continue to improve every year.
The worst part is that they have to compete with free, and that's never easy, especially if you're talking about "well, it's still distorted, but the distortion is less displeasing to the eye", also you need to configure some pain in the ass licensing system and work out how to do the payments.
Because a great proportion of people browsing the web have slow connections and/or data caps.
> How about more quality and the same filesize?
We're already able to get acceptable quality.
That doesn't matter one bit. See "webpages are doom".
>We're already able to get acceptable quality.
Apparently not when some examples are worse.
BPG (Better Portable Graphics) is a new image format. Its purpose is to replace the JPEG image format when
quality or file size is an issue. Its main advantages are:
* High compression ratio. Files are much smaller than JPEG for similar quality.
* Supported by most Web browsers with a small Javascript decoder (gzipped size: 56 KB).
* Based on a subset of the HEVC open video compression standard.
* Supports the same chroma formats as JPEG (grayscale, YCbCr 4:2:0, 4:2:2, 4:4:4) to reduce the losses during the
conversion. An alpha channel is supported. The RGB, YCgCo and CMYK color spaces are also supported.
* Native support of 8 to 14 bits per channel for a higher dynamic range.
* Lossless compression is supported.
* Various metadata (such as EXIF, ICC profile, XMP) can be included.
* Animation support.
[1] https://bellard.org/bpg/• In countries with software patents it's illegal to use BPG without a patent license for the H.265 codec, and that patent pool is a mess. Someone needs to do BPG with AV1 payload, or just wait for browsers to finish implementing AVIF.
• JavaScript adds significant latency. Browsers request native images before running any JS, so even an infinitely fast JS polyfill already starts from a losing position. On top of that, low-end devices are likely to spend more time and energy on running the JS decoder than on downloading a larger JPEG.
I think you answered your own question right there.
I'm not going to use a dumptruck to bring a single sack of sand to my garden.
I wonder how good the performance of that decoder is, though; if the decoding delay is much longer that the network transfer delay, the approach becomes much less appealing.
That means that in most cases the main driver is lower network transfer and you need to be serving a LOT of images to outweigh the cost of having to support something new and complicated versus something as widely tested and supported as JPEG.
Not to mention it could be feature detected via browser, js and other means as an interim solution. Also, I'm pretty sure the implementation is wasm with a very thin JS shim, at least that would be my presumption as I'm not familiar with this format/project.
AVIF however may have a chance.
Key questions: (1) Is it encumbered by any patents? (2) Does a formal description of the algorithm exists, to allow for independent implementations? (3) Does a MIT/BSD or at least LGPL implementation exist? (4) Has it been submitted for standardization?
Technical merits are of limited value if you can't deploy them.
That said, I do think it's a neat project and can be used if there are proper fallbacks to formats that are natively supported.
Isn't it Fabrice Bellard?
@als0: Thanks for pointing that out.
That's not to say it isn't lower quality, when looking in detail you see it... but for a lot of use cases (and in video) much better experience in general.
Also, the latest news entry:
> (Apr 21 2018) Release 0.9.8 is available
Edit: Spoke too soon. “Official” HEIF JavaScript port measures ~500-600k gzipped, so 56k gzipped is an advantage.
Not so much anymore. The licensing fiasco with HEVC has reduced MPEG's relevance, particularly for web video. Here's what Leonardo Chiariglione, founder and chairman of MPEG, says about it:
https://blog.chiariglione.org/a-crisis-the-causes-and-a-solu...
https://blog.chiariglione.org/stop-here-if-you-to-know-about...
And they're shaping up to make VVC (https://en.wikipedia.org/wiki/Versatile_Video_Coding) licensing just as bad.
Leonardo says there is no longer a united MPEG:
https://blog.chiariglione.org/a-future-without-mpeg/
Why would anyone waste their time on a format with complex and uncertain licensing when they can just implement AV1 with its simple, royalty-free licensing?
https://en.m.wikipedia.org/wiki/High_Efficiency_Image_File_F...
Windows, OSX, iOS and Android have support baked in already
HEIF is just a generic image container format. It’s almost identical in structure to a .mp4/.mov/.av1 file (follows ISO BMFF) and can be parsed in an identical way using a simple tree structure. That’s a perfect fit for wrapping a single video I-frame as an image, the basis of all of these new image codecs.
Note that video I-frames can often only be properly rendered using metadata from outside the bitstream, such as HDR characteristics, color profile, or orientation. Sharing that metadata structure with the codec’s canonical video format is the only way to be forward-compatible.
A HEIF that wraps AV1 frame(s) is an .avif
A HEIF that wraps HEVC frame(s) is a .heic
Codecs will change, but the HEIF container is probably the last bitmap file format that we’re going to need for decades.
I managed to refit it with `<picture>` tags using WEBP as well as JP2. The latter was a great deal of trouble, it appears that "the community" (notably Gatsby and Contentful) are very happy to talk about the benefits of WebP but conveniently ignore that Safari is the most important mobile browser, and Safari desktop is not insignificant.
I bring this both to point out that there is a very valid reason to use WebP over JPEG — alpha blending — and that this entire field is still a gigantic mess.
Does the WebP format permit bounded areas of an image to be represented at lower fidelity with a smooth blur, so that the blurred-background effect can be stored and retrieved using fewer pixels and a blur algorithm rather than more pixels and no blur algorithm? Do PNG or HEIF (h265) support this? Does any image format support bounded areas of lower fidelity?
The tricky part is that this implies that some areas of the image should intentionally be reproduced as ‘lossy’ and ‘lower fidelity’ and so forth, which is precisely correct - but goes against the grain of image encoding in the past.
Doing this formally at scale would require the compositor and the encoder to cooperate, as the encoder would benefit greatly from having access to both the 'blurred' and 'unblurred' areas without the blur filter having been applied to the former, as it could then construct low-fidelity, low-bandwidth, visually pleasing blur for the 'blurred' segments.
This exceeds my ability to write PNGs by hand and it certainly exceeds the bounds of what most people think 'an encoder' should be capable of doing, but at least it presents a path forward. I'll post to HN someday if I ever somehow manage to do this.
(This isn't just relevant to Apple users — imagine if Photoshop's PNG/HEIF encoder could export blurred segments with lower byte density than unblurred segments, for example. Folks generally are not used to thinking about fidelity-sensitive image encoding, and that's why this is so interesting to me.)
Good to hear. But that still means it'll still be 1½ years before enough users in the wild are on iOS 14 to make the change without breaking the sites for a large number of people. At least, from what I read, iOS upgrade adoption is very quick compared with other platforms.
WebP is something to look forward to on my company's internal projects, but externally we still have to support IE11, as it's still very widespread in the medical field, and I haven't seen the user numbers budge on that.
The space savings is quite nice for my bandwidth bills (my websites don't have video, so I estimate saving about 20% in bandwidth costs, or approximately $120/month across all of them).
Yeah, you can do manual alpha masking in webkit, but it's freaky and stupid.
-webkit-mask-image does exactly what you're looking for (poorly) :+ )
The other way to do it is SVG, but if you want that to be data efficient, you generally end up with three HTTP requests at two levels for a single image, or you have base64 and it has to be gzipped or it's larger.
Still something like 5x what I would recommend to most folks, but there’s just no getting around a site like this being very photographic.
(Edit) I can’t attribute all of this to next-gen images, also doing lazy load and other tricks.
Feel free to shoot me an email if you don’t want to respond here. rouven _at_ contentful _dot_ com
But sometimes you can't support it without huge hacks like implementing everything on CPU with WebAssemply. For example MediaSource is disabled on Safari for iPhones (but enabled since a few months for iPads). I think the only reason is to force developers to publish apps in the AppStore. Which is a pain.
Realistically people should be using either Safari or Firefox during their development. Then check for chrome compatibility after.
The reason for this is basically that most codecs do not target SSIM internally. They're using their own algorithms to determine how to allocate bits, so two images with the same SSIM may look better or worse depending on what codec is used. Many modern codecs (e.g. from x264 onwards) deliberately take approaches that lower the score of the result on objective metrics but usually look better to the human eye.
This exact issue was originally highlighted on the x264dev blog: "How to cheat on video encoder comparisons" #3: "Making invalid comparisons using objective metrics". [1]
If you really want to compare image codecs, I'd look at one of the many comparisons from this family on Github. [2]
In my judgment WebP is clearly better than Mozjpeg for most images.
[1] https://web.archive.org/web/20141103202912/https://x264dev.m...
[2] https://wyohknott.github.io/image-formats-comparison/#abando...
But the truly amazing next generation VVC manage to compress image with even better ratio than JPEG XL.
Both JPEG XL and VVC is expected to be finalised in July/Augest. JPEG XL will be royalty free. VVC as usual is lots of unknown.
[1]https://cloudinary.com/blog/how_jpeg_xl_compares_to_other_im...
[2] https://medium.com/@scopeburst/mozjpeg-comparison-44035c42ab...
It can be illuminating to stretch codecs a bit past the visually-indistinguishable threshold, both to better nail down where that threshold is and to see how annoying the artifacts you end up with are. Lots of comparisons you can do; this is a fun one: https://encode.su/threads/3108-Google-s-compression-proje%D1...
At very few bits-per-pixel like the first (bridge) image, everything has some artifacts. On that image AVIF tends to just blur lower contrast areas, whereas HEIC produces some visible ringing (faint lines that weren't there before) around the bridge. Unlike JXL, AVIF and HEIC both have spatial prediction (extend pixels above/to the left of this block in whatever direction), which is particularly helpful with straight sharp lines like the bridge image happens to have. I wouldn't put too much stock in results on that one image, but I do like being able to judge results subjectively.
(FWIW, a presentation on JPEG XL suggested they were targeting the equivalent of ~2bpp JPEG quality[0], so perhaps performance in this super-low range wasn't as much of a priority.)
Anyway, I hope both these formats get wide support, because they each have clear benefits in some application: JXL's include the upgrade path for JPEG1 content and the multiple modes, and AVIF may be able to salvage a bit more quality at super low bitrates. AV1 (on which AVIF is based) has wide industry backing, and the JPEG XL effort is also going for a royalty-free codec and has support from Google, so hopeful they actually will be usable relatively soon.
(Although HEIC's images are OK and it has Apple's support already, it's patent-encumbered, limiting what you or I can do with it.)
[0]: https://www.spiedigitallibrary.org/conference-proceedings-of...
I wouldn't call the decision to support a format 6 years after first evaluating it a walk back, it's a concession that the format has been adopted by the industry. If the most popular browser supports WebP and sites are using it, it makes sense that you should support it.
Here's a MEGA folder with my example files so you can compare for yourself. Sorry I know this host might be blocked in many places, but every image host I tried (imgur, postimg) recompressed my uploaded files negating the fairness of the test. If anyone has a suggestion for a better host I'm happy to re-upload.
https://mega.nz/folder/JsUXWIqI#xYIohBdiVKrGYTi-BeENEA
e: another host: http://www.filedropper.com/libvipswebpvsjpeg
My random sample is a black-and-white JPEG photograph vs its WebP equivalent. The results are in line with my results for many other images of different types, like other black-and-white photos, color photos, clean computer graphics, screenshots of UIs and media/games, etc etc. The original image for this test can be found here: https://en.wikipedia.org/wiki/Sand_Hill_Road
Both test images were output by libvips after loading the original JPEG. The libvips-generated JPEG is 1.22mb, smaller than the 1.26MB original, but the libvips-generated WebP is 944KB! I included two sceenshots of each libvips-generated version opened in a same-size window too, both much smaller than the full res. Tabbing between the two on my PC does not visibly change on screen at all.
I don't entirely enjoy WebP just because the software support is still spotty, but I haven't been able to argue with the compression benefits!
I'm a typical social networks browser, so among the images I see a high majority of them don't need high quality. I'm running the extension with max compression but still keep colors: compression artifacts are clearly visible, but in my opinion they're not a problem. Looking at /r/all right now, there are 2 images that "deserve" to remain at the original resolution, the rest is typical pictures of text/memes that don't need all the bytes they currently have.
The result: overall I saved 80% of data, just with images.
In my case it's not so much a debate of JPEG vs WebP, but a debate of whether it's ok to keep images _on the web_ in their unoptimized form the way they are today, to which of course my answer is no. We don't need high quality images of a Facebook screenshot when compressing it to 20% of its original size can convey the same information with no subjective loss.
I do agree on the unwieldy nature of WebP though, it's still mostly a read-only format right now and turns the web into a consumption platform
https://www.pixelz.com/blog/guetzli-mozjpeg-comparison/
"MozJPEG files had fewer bytes 6 out of 8 times
MozJPEG and Guetzli were visually indistinguishable
MozJPEG encoded literally hundreds to a thousand times faster than Guetzli
MozJPEG supports progressive loading"
In terms of absolute bytes to pass this threshold, Guetzli felt the best when I was doing the research (~ mid-2017). I don't have any hard data to back this though - I did the experiment with 5-6 different product images, drew the conclusion and started using Guetzli.
Well, MozJPEG didn’t exist until four years after WebP, so I suspect that might explain why.
The Java wrappers around a native binary are helpful, but for many projects not very useful and this hinders adoption.
https://github.com/haraldk/TwelveMonkeys/issues?q=is%3Aissue...
For the images I serve on my sites, a few KB here and there aren't going to make a huge difference, and I'd rather avoid the hassle of serving content that isn't universally supported.
Zoom in (400%) on the cap of the yellow hat. The lines of the cap are muddied under all lossy compressed formats, but surprisingly, plain old cjpeg does so less than the others.
Generally though I find the new formats look better than JPEG.
WebP did not take off.
But will AVIF be any better?
https://netflixtechblog.com/avif-for-next-generation-image-c...
AVIF is an image format based on the intra-frame coding of AV1, as WebP is to VP8 and HEIF is to HEVC.
AV1 and HEIF are super recent though, the AVIF 1.0 spec was only released in early 2019. By comparison, WebP was initially released in 2019. So AVIF currently has very little support (it's behind flags in Firefox and that's it).
However all the big names are part of AOM, which oversees AV1 (and AVIF): http://aomedia.org/membership/members/
So chances are pretty high it'll get widespread support, eventually.
There’s one problem though: like WebP, AVIF just is not solving a big issue.
+ WebP was initially released in 2010
I don't think WebP is it, but we'll see what comes out of the scrum. I'll work with whatever that is, but I won't waste my time chasing will o' the wisp "standards."
The polyfill is still kind of slow, at least compared to native PNG rendering on the browser, but it does work, and hopefully some day it can be integrated into the standard.
[0] http://flif.info
see jpeg-xl
I started writing Web sites in the mid-'90s, where a page was supposed to be about 30K (quaint, huh?).
The prevailing wisdom, then, was no dither, adaptive palette, and reduce the color palette until it hurts, then back up one.
https://caniuse.com/#search=heif
I'm surprised that Safari doesn't support it.
I believe Apple released a bit of Javascript that lets you embed the animated HEIF images (I think they're called "live pictures") in your web site, but that's kind of a niche use.
> proprietary
No. It is an open standard (ISO/IEC 23008)
WebP is based on VP8, which was considered to be competitor to H.264 (AVC). HEIC is based on H.265 (HEVC), which competes with VP9 and AV1. So I'd assume WebP is one generation behind HEIC. WebP was introduced 5 years before HEIC though.
So WebP is hardly new, and a couple of generations behind. Now the next hotness is AVIF (or maybe JPEG XL), so ironically, WebP is becoming usable and obsolete at the same time.
Apple started supporting it in 2017. Microsoft in 2018.
You are correct, though — it's not supported by any browser.
A straightforward encoding of a JPEG into a WebP (using GIMP) does give me an almost 1/3rd reduction in file size, which is not insignificant.
The easiest way to do a simple comparison might be to install ImageOptim and process a few images with various tools. Based on that you could put the same tools into your site’s workflow.
[Update] Just noticed he's going JPEG->WebP so my comment makes no sense.
FLIF & FUIF were created by Jon Sneyers - http://sneyers.info/ and are lossless but progressive, generating better resulting images at every step of the image download and brilliant mobile support (your browser can just stop downloading the image once it reaches the quality sufficient for the viewport).
A new update on the JPEG XL is worth reading:
--> https://cloudinary.com/blog/how_jpeg_xl_compares_to_other_im...
[0] http://flif.info/ -- superseded by FUIF
[1] https://cloudinary.com/blog/fuif_new_legacy_friendly_image_f... -- FLIF is lossless and amazing, in part absorbed by JPEG XL
[2] https://github.com/google/pik - from Google, got absorbed by JPEG XL
[3] https://cloudinary.com/blog/how_jpeg_xl_compares_to_other_im...
it has been. look up avif, you can already sorta try it out on firefox nighty.
For anyone interested and building sites with Next.js, I've released a plugin for optimizing images and converting to webp with fallback to jpg/png: https://github.com/humaans/next-img/
I run this https://www.gumlet.com which serves more than 50M images per day. We can put entire study on different image formats if HN finds it helpful. Please let us know.
You spend all this time improving your stack, reducing your app bundle size, convincing your company on the benefits of server side rendering, improving your devops, getting your manager to see these measurable benefits by running lighthouse audits themselves etc...
Then all of a sudden it turns out that the main tool you used for this has been turned into a.. a fking ad platform.
I apoligise for this emotionally charged rant, but seriously though, is that how you plan on getting developers adopt your dubious new standard, by p*ssing them off?
I'd be curious to see a WebP vs PNG comparison, since (IIRC) it has a lossless mode too.
WebP Lossless almost always results in a smaller file than PNG. I have seen exceptions to this, but they're sufficiently rare that it's not worth worrying about.
However the main benefit of webp is alpha backgrounds or transparency. It can destroy PNG when it comes to compression and size.
Couldn't the person who picks the compression ratio tell the encoder which part of the image is important? And even have it done automatically to some extent. If you are going to send a 5MB picture from a person at their birthday party, if feels worth it to spend a few more bits on that person than its surroundings.
Extrapolating to smartphone pictures where you generally select a focus area (and sometimes selectively blur the rest), they could use that information to keep more bits of information in this area.
https://news.ycombinator.com/item?id=22245788
Also, Google has a "brunsli" library, that can recompress JPEG to JPEG XL format without loss.
Some formats that have a lossless mode: TIFF, WebP, BPG, JPEG XR.
FLIF claims to have the best ratios, and they have some benchmark info on their web page (https://flif.info/).
There are other things to consider like encoding/decoding speed, compatibility, and patents/licensing.
Oops, I failed to mention JPEG XL!
JPEG XL is newer technology, more likely to be supported by browsers, and it pretty much obsoletes FLIF. It's still pretty new but may be the best bet.
More info: https://jpeg.org/jpegxl/index.html
If you've got a standard sRGB 8-bit-per-channel image, though, the loss from JPEG at q95 or q100 is negligible, and means your image still enjoys wide app compatibility.
If it's something else (like a raw format from a DSLR), the best you can do is retain the original file.
Also: don't forget file metadata! I inadvertantly deleted all EXIF headers from a number of my original images many years ago because I used jpegtran (without the -copy option!) to losslessly rotate images. I ended up adding a bunch of heuristics in PhotoStructure to automatically infer missing metadata to repair this mistake.
There are tools that let you re-encode a PNG after applying a lossy filter, but the PNG still encodes it losslessly.
Edit: saw somewhere that it is used in production for real-time video, but had trouble using rav1e as opposed to libvpx
Not that I trust Google, but in this case I don't see the harm.
Google did it with Android. It's "open source", but try to do something without Google Play Services.
Mandatory Google bash comment: - It's mainly another wheel reinvention from Google, because reasons.
WebP seems to have been the first "let's just use intra-frame coding" image format out there though, and it's hardly the first format to have tried to unseat JPEG.
WebP is 4 years older than BPG (Bellard's HEVC-based format), 5 years older than HEIF (MPEG's same) and AVIF was only specified 9 years later.
Back then it made a lot of sense to also have an image format based on exactly VP8 (despite it being a poor fit for still image format), since everyone promised to support it, including hardware acceleration.
But Adobe never added VP8 to Flash, hardware support was too little too late. VP8 died, and WebP is burdened with compatibility with a world that never materialized.
Pithy comment, and reaction, aside, that's enough to give me pause about implementing it.
2 years later
We have too many different formats! Let's make a new standard!
shrug
- supports lossless
- supports alpha
- excellent decode speed
- open business friendly license
In essence, it eliminates PNG.
Edit: Looks like it was that specific website and they are doing something odd, so I retract my initial judgement.
And it's also a very annoying to deal with them, I might add, especially when you need to save them or to work with them, as they are not natively supported by macOS or win.
https://chrome.google.com/webstore/detail/save-image-as-type...
In theory, you could probably do some combination of altering the user agent, and/or blocking .onload for webp images (which is often used to detect webp support).
If you changed both, most sites would probably serve you a jpg/png version.
WebP is a blatant example of how monopoly power is used to push bad things upon everyone else, and as seen here, for literally no good technical reason.