Live data from Hacker News

Is WebP really better than JPEG?

siipo.la

261–270 of 319 posts

Re: Is WebP really better than JPEG?

#261
Unfortunately, targeting same SSIM makes this test basically bullshit. It would be far better to make images that are the same size, and then we can use both our eyes and various objective metrics to compare the images.

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...

Re: Is WebP really better than JPEG?

#262
post #122
post #86

Every time I run an image comparison, the webp version looks worse and yet Google insists it's the same quality. It's baffling. 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…

I also don't get it why people insist on the same quality with lesser size. How about more quality and the same filesize?

Part of it is about quality. These new formats now support 10+ bit color depth (which is critical for modern displays and for HDR) and full 4:4:4 chroma subsampling (to preserve pixel-level as needed). Many apps/services are currently evaluating or already migrating to AVIF or HEIC because these formats unlock those improvements in image quality, even without a major reduction in file size.

Re: Is WebP really better than JPEG?

#263

I just relaunched a website that makes extensive use of photographic collages that necessitate alpha backgrounds. They were previously shipping "retina-grade", multi-megabyte images all over, a typical page load could easily reach 25mb. I managed to refit it with ` ` 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 t…

On iOS, any screenshot taken while iOS background blur is active will balloon from 0.15MB to 15.0MB, because iOS uses PNG for screenshots and blurred backgrounds are apparently irreducible by PNG. 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…

HEIC (HEVC-based image) and AVIF (AV1-based image) both support a lossless mode that does efficient compression of blurs and gradients, without losing any visual fidelity. They're good candidates for screenshots in the future. Lossless HEIC is often 50% of the size of the equivalent PNG.

Re: Is WebP really better than JPEG?

#264
post #257

Earlier quoted context omitted.

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.

vector graphics and raster graphics aren't really comparable.

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?

#265
post #264

Earlier quoted context omitted.

vector graphics and raster graphics aren't really comparable.

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.

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?

#266
post #113
post #66

I wonder, why nobody mentioned Patrice Bellard's BPG[1]. It is based on HEVC and can be supported in any browser via a Javascript. From his website: 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 b…

> I wonder, why nobody mentioned Patrice Bellard's BPG[1]. Isn't it Fabrice Bellard?

It is

Re: Is WebP really better than JPEG?

#267

One of the biggest barriers against adoption of these newer formats is the lack of pure java implementations for use server side. 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...

Using Java code for things that are this performance critical doesn't feel like a good idea. It will work of course, but it will probably GC a lot, and while modern JVMs do JIT, the code they generate can't be as optimal as something that has manual SIMD optimizations.

Using C code is how you get the next cloudbleed. I'm happy to pay a performance cost for the sake of memory safety.

Re: Is WebP really better than JPEG?

#268

As someone who hosts images on their site, what is the best software (preferably open source) one can use to compress JPEG images imported from a digital camera? I would be glad to serve only JPEGs and dispense with WebP versions and simplify my site html. 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.

Just going by elsewhere in the thread, if you want to not lose any quality then brunsli / Jpeg XL sounds like the way to go.

Re: Is WebP really better than JPEG?

#269
post #227

Earlier quoted context omitted.

WebP also supports animation, which is important because GIFs are notoriously large.

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.26…

Do people really use Safari?

Re: Is WebP really better than JPEG?

#270
post #227

Earlier quoted context omitted.

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.26…

Do people really use Safari?

[deleted]
Post reply on HN