Psythik,

I thought webp was just a container format?

Turun,

No, it’s an image compression format derived from the VP8 codec.

Sprite,
@Sprite@lemmy.ml avatar

Yesss! If apps accepted webp, I’d be fine, but many things like Discord and so on don’t accept it, at least for avatars.

Dark_Arc,
@Dark_Arc@social.packetloss.gg avatar

Discord is such a pain in terms of sticking to ancient stuff and having arbitrary limits.

I wish it hadn’t taken off like it did… But it was free so ofc…

IronKrill,

The other services at the time had many more limits or annoyances, hence why Discord has the userbase it does today.

Chronographs,

If something doesn’t support webp you should really be converting it to png not jpg so it doesn’t get more degraded

JohnDClay,

Isn’t jpg more efficient for pictures, whereas png is better for graphics type elements with defined colors and edges?

eerongal,
@eerongal@ttrpg.network avatar

Jpg is really bad for anything with sharp lines, such as text. It also doesn’t support alpha channel (transparency) which is reasonably important in modern web design.

PNG is loseless, which is great for… anything other than storage/bandwidth due to file size. There’s even an animated PNG standard, similar to animated GIF, but you never see that used anywhere.

Chronographs,

Jpg is lossy and throws away information every time it is used, that’s why you get the “deep fried effect” when you re-encode something repeatedly. PNG is lossless so it’s a perfect replica of whatever image you encode with it. It does take up more space however.

LillyPip,

Minor niggle: the ‘deep fried effect’ isn’t because jpg throws away information every time, it’s because the compression algorithm averages pixel boundaries, and that averaging multiplies with each compression pass.

It can actually bloat the size of the file by adding information – adding data to previously null pixels, whereas png would keep them clean.

e: it achieves this through pixel averaging (fuzzing), which is why you’ll see grey artefacts bleeding into the pixels around line art. This is magnified with each compression.

Slotos,

You’re conflating “data” with “information”.

Repeated re-encoding loses information. “The compression algorithm averages pixel boundaries” is a perfect example of losing information.
That it sometimes results in more bits of data is a separate phenomenon altogether.

Kwdg,

Why do you need to convert to jpg?

JackbyDev,

A lot of apps don’t support webp yet. Facebook Messenger is a good example. If I want to share a meme that was webp it says “GIF” in the gallery and says it can’t upload images in that format.

willya,
@willya@lemmyf.uk avatar

The compression to quality ratio of webp is amazing, especially webm. Some instances have this conversion happen upon upload would be my guess to save a crazy amount of space.

underisk,

Not just space, bandwidth.

Piemanding,

Bandwidth is just space across wires. Or maybe space per second.

BorgDrone,

WebP is a tiny bit better on small images and slightly worse overal than JPEG, when using a good encoder library (mozjpeg). It is better than standard libjpeg but that’s not really a fault of the format as much as of the specific encoder.

MHLoppy,
@MHLoppy@fedia.io avatar

It depends a lot on what's being encoded, which is also why different people (who've actually tested it with some sample images) give slightly different answers. On "average" photos, there's broadly agreement that WebP and MozJpeg are close. Some will say WebP is a little better, some will say they're even, some will say MozJpeg is still a little better. Seems to mostly come down to the samples tested, what metric is used for performance, etc.

I (re)compress a lot of digital art, and WebP does really well most of the time there. Its compression artifacts are (subjectively) less perceptible at the level of quality I compress at (fairly high quality settings), and it can typically achieve slightly-moderately better compression than MozJpeg in doing so as well. Based on my results, it seems to come down to being able to optimize for low-complexity areas of the image much more efficiently, such as a flatly/ evenly shaded area (which doesn't happen in a photo).

One thing WebP really struggles with by comparison is the opposite: grainy or noisy images, which I believe is a big factor in why different sets of images seems to produce different results favoring either WebP or JPEG. Take this (PNG) digital artwork as an extreme example: https://www.pixiv.net/en/artworks/111638638

This image has had a lot of grain added to it, and so both encoders end up with a much higher file size than typical for digital artwork at this resolution. But if I put a light denoiser on there to reduce the grain, look at how the two encoders scale:

  • MozJpeg (light denoise, Q88, 4:2:0): 394,491 bytes (~10% reduction)
  • WebP (light denoise, Picture preset, Q90): 424,612 bytes (~29% reduction)

Subjectively I have a preference for the visual tradeoffs on the WebP version of this image. I think the minor loss of details (e.g., in her eyes) is less noticeable than the JPEG version's worse preservation of the grain and more obvious "JPEG compression" artifacts around the edges of things (e.g., the strand of hair on her cheek).

And you might say "fair enough it's the bigger image", but now let's take more typical digital art that hasn't been doused in artificial grain (and was uploaded as a PNG): https://www.pixiv.net/en/artworks/112049434

Subjectively I once again prefer the tradeoffs made by WebP. Its most obvious downside in this sample is on the small red-tinted particles coming off of the sparkler being less defined, [see second edit notes] probably the slightly blockier background gradient, but I find this to be less problematic than e.g., the fuzz around all of the shooting star trails.. and all of the aforementioned particles.

Across dozens of digital art samples I tested on, this paradigm of "WebP outperforms for non-grainy images, but does comparable or worse for grainy images" has held up. So yeah, depends on what you're trying to compress! I imagine grain/noise and image complexity would scale in a similar way for photos, hence some of (much of?) the variance in people's results when comparing the two formats with photos.


Edit: just to showcase the other end of the spectrum, namely no-grain, low complexity images, here's a good example that isn't so undetailed that it might feel contrived (the lines are still using textured [digital] brushes): https://www.pixiv.net/en/artworks/112404351

I quite strongly prefer the WebP version here, even though the JPEG is 39% larger!

Edit2: I've corrected the example with the sparkler - I wrote the crossed out section from memory from when I did this comparison for my own purposes, but when I was doing that I was also testing MozJpeg without chroma subsampling (4:4:4 - better color detail). With chroma subsampling set to 4:2:0, improved definition of the sparkler particles doesn't really apply anymore and is certainly no longer the "most obvious" difference to the WebP image!

damian101,

Webm is just a video container, not a format. WebP uses quite outdated image compression from the VP8 video codec, which may perform quite a bit better than JPEG at very low quality, but at near-transparent quality, which images are usually encoded to, it very often doesn’t even beat JPEG.

isVeryLoud,

Don’t forget that JPEG-XL is better, yet Google refused to implement it in Chrome to push their own webp format so it’s basically DOA.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • asklemmy@lemmy.world
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #