google / guetzli

Perceptual JPEG encoder
Apache License 2.0
12.92k stars 976 forks source link

Why not progressive? #54

Open JasonMrX opened 7 years ago

JasonMrX commented 7 years ago

Guetzli generates only sequential (nonprogressive) JPEGs due to faster decompression speeds they offer.

I thought that image-heavy websites prefer progressive mode than sequential mode (facebook, instagram), etc). I haven't done bench marking myself, but how much faster is sequential mode in terms of decompression speed?

robryk commented 7 years ago

Decompression speed of progressive JPEGs is 10-200% slower; the slowdown is worse on underpowered devices. This matters even more when we have an image that is already cached on an underpowered mobile phone.

kornelski commented 7 years ago

If you're more concerned about bandwidth than CPU time, you can use MozJPEG's jpegtran to losslessly convert Guetzli images to progressive. This even reduces file size further.

tomByrer commented 7 years ago

@robryk A website that is properly configured won't be serving small devices full-sized images, so your CPU concern won't have that much impact. Also with HTTP2 PJEPGs could be rendered to screen faster regardless.

pieroxy commented 7 years ago

@tomByrer I would argue that a properly configured website will serve high density screens bigger images, if only because they have more pixels to display them. Coincidentally, those screens are often the smaller out there, in phones and tablets. So small devices are likely to get served bigger images than desktops and laptops.

ghost commented 7 years ago

@JasonMrX If you're using Windows, try jpegtran_do_plus. I found it yesterday and it work well.

tomByrer commented 7 years ago

@pieroxy Often mobile will have different 'art direction' (cropping) than a desktop or even 4k site would have.

You're correct that DPI should be a concern for many web images; something I intend to address with progressive. A full explanation is worthy of a blog post, not a GH-issues discussion ;)

pieroxy commented 7 years ago

Agreed. FYI I wrote a small piece a while back on how to compress images for high-dpi screens.

http://pieroxy.net/blog/2016/05/01/jpeg_compression_is_80_the_magic_quality_part_1_the_retina_screens.html

tomByrer commented 7 years ago

chances are that you will serve your bigger images to your slowest users. That doesn't sound right.

hehehe :) Looking at your examples on my regular desktop 1080p, it would seem that retina-sized at higher compression would be best for both screen types. Another article came to the same conclusion.

pieroxy commented 7 years ago

Looking at your examples on my regular desktop 1080p, it would seem that retina-sized at higher compression would be best for both screen types

... and would be much bigger than a lower compression of a non-retina version, so no, it was not my conclusion. :-)