Hacker News new | ask | show | jobs
by Timmmmmm 4187 days ago
I have a feeling that nobody would really bother with WebP for its compression, but does JPG/PNG have:

* Lossy compression with alpha channels. * Efficient lossless compression of photo-like images. * Efficient compression of photo-like and diagram-like images in the same format (and in the same image, e.g. screenshots containing photos). * Good lossy compression of diagram-like images.

No.

2 comments

• Currently you can use lossy PNG: http://pngmini.com/lossypng.html

• There's a draft for gracefully-degrading JPEG eXTensions that add all the features you want http://www.jpeg.org/jpegxt/index.html (by encoding classic JPEG + residual image hidden in JPEG metadata).

WebP is a bit of a hack: it has JPEG-like algorithm for photos (VP8) and a custom PNG-like algorithm for lossless. Technically it's not much different than having JPEG and PNG and using same filename extension for both.

JPEG 2000 and JPEG XR have truly scalable algorithm that can support lossy and lossless.

> nobody would really bother..

I did, last summer, converted all images (35K) on my NSFW hobby site (check profile) to WebP with no jpeg fallback or shabby javascript decoder (which don't work on very high res images), and haven't looked back.

On my journey to 1000ms-to-glass with a site like mine, I'm going to go with the format that gives me dramatic size savings, thank you Google.

That said, I can see how it benefits Firefox users not to be able to render WebP... sigh.

It would be helpful if 4chan followed my lead by at least allowing users to post WebP with something like mod_pagespeed running.

> I'm going to go with the format that gives me dramatic size savings, thank you Google.

As far as I've seen, testing has shown that WebP is not dramatically better than JPEG, as long as you're using a clever encoder (like MozJPEG, which is what we're talking about). If you have evidence to the contrary, I'm sure the MozJPEG guys would appreciate a test-case!

> That said, I can see how it benefits Firefox users not to be able to render WebP... sigh.

Instead of spending energy on dubious WebP, Mozilla spends energy on improving JPEG (which benefits everybody now) and Daala (which will hopefully benefit everybody eventually). I think it's a pretty sensible trade-off.

4chan? They've only started to serve static content from a cookie less domain about a year ago http://chrishateswriting.com/post/68794699432/small-things-a.... When it's a known web performance technique for quite some time. Jeff Atwood did this at Stack Overflow in 2009 http://blog.stackoverflow.com/2009/08/a-few-speed-improvemen...
What particular sorcery do you use that prevents your site from serving Firefox browsers?
An nginx redirect based on user agents to an apology and a list of download links to WebP friendly browsers. I used to include a link to a Firefox fork that supported WebP natively, but no one bothered.

I made a sort of Google+ companion to the site which I'd bump them onto but I still haven't gotten the hang of not getting banned.

ngx_pagespeed would be another way of serving WebP to supporting browsers and JPEG to others.
Yes, but not when storage, bandwidth, money, a desire to deliver only the best user experience (or nothing) and pushing WebP are concerns.

By the way, it's remarkable when running an image-heavy site how much bot/mass downloader traffic relative to humans vanish when turning away Firefox user agents.

Your profile doesn't say anything.
Your site doesn't work as of right now.