Photo compression is nowhere near lossless

34 views
Skip to first unread message

Danny Michel

unread,
Mar 3, 2017, 6:18:42 AM3/3/17
to ngx-pagespeed-discuss
Hello and apologies if i'm missing something, but my photos are compressed very harshly and lossy.
Am I doing something wrong?
pagespeed EnableFilters insert_dns_prefetch,rewrite_domains,local_storage_cache,extend_cache_pdfs,elide_attributes,outline_css,prioritize_critical_css,move_css_to_head,outline_javascript,combine_javascript,rewrite_javascript,include_js_source_maps,inline_javascript,make_google_analytics_async,extend_cache,rewrite_images,responsive_images,resize_images,convert_jpeg_to_progressive,convert_png_to_jpeg,convert_jpeg_to_webp,convert_to_webp_lossless,remove_comments,collapse_whitespace,insert_ga;


Joshua Marantz

unread,
Mar 3, 2017, 6:37:13 AM3/3/17
to ngx-pagesp...@googlegroups.com
Note: you can split your config up into multiple lines so it's easier to read.  E.g.

pagespeed EnableFilters insert_dns_prefetch,rewrite_domains;
pagespeed EnableFilters local_storage_cache,extend_cache_pdfs,elide_attributes;

One idea is to group by function (e.g. all image-related filters together)


Now to answer your question (with a question :), can you give a specific example, including:
  • Source image
  • Details of client (browser, device, connection, was Chrome 'Save Data' enabled?)
  • Rewritten tag (eg was this related to the 'responsive_images' filter?)
  • Rewritten image
Then we can take a more detailed look.


--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

Danny Michel

unread,
Mar 4, 2017, 2:44:50 AM3/4/17
to ngx-pagesp...@googlegroups.com
Thank you
I believe it has something to do with the fact that these images are being compressed and I am viewing them on a retina Mac.
I thought resize_images and responsive_images was supposed to take care of that
Doesn't seem to be

Danny Michel

unread,
Mar 4, 2017, 7:04:21 AM3/4/17
to ngx-pagesp...@googlegroups.com
I know this image isn't very high res, as it's a polaroid, but you can see the difference in her leg and face
I understand there will be some loss during compression, but the word 'lossless' indicates otherwise

Danny Michel

unread,
Mar 4, 2017, 7:05:59 AM3/4/17
to ngx-pagespeed-discuss

Joshua Marantz

unread,
Mar 4, 2017, 9:12:24 AM3/4/17
to ngx-pagesp...@googlegroups.com
I have to confess I cannot tell those two apart, by loading them into two different Chrome tabs on my retina mac and toggling between them with cmd-2 and cmd-3.  I can detect that something is changing but I couldn't pick out which one has been optimized without looking at the URL. I feel like we are doing a pretty good job here :)

Moreover, the options you have suggested do not claim to implement lossless compression.  However you can control the image compression level.   See https://modpagespeed.com/doc/filter-image-optimize#image-quality for details.

Whether or not the responsive images filter is working properly on your site will be harder to say until you send the URL of the HTML that instantiates these images.  However, based on the URL names I think it is *not* working, because xIMG_3926-1.jpg.pagespeed.ic.i82D4a0n6X.webp does not show we've done any resizing on this image, probably because its img tag does not have width/height attributes.

-Josh 

--
Reply all
Reply to author
Forward
0 new messages