[英]Google PageSpeed Insights Optimize Images Compressing and Resizing
Google PageSpeed Insights is saying that I should compress and resize several images. Google PageSpeed Insights表示我应该压缩并调整几个图像的大小。
Here's an example: 这是一个例子:
I saved this image using Photoshop's Save for Web JPEG High preset: 我使用Photoshop的“ Web JPEG高保存”预设保存了此图像:
What can I do to this image to avoid Google's "compress and resize" warning? 我如何处理这张图片,以避免Google出现“压缩和调整大小”警告?
This is what works for me and JPEG to be on the safe side of PageSpeed Insights. 这对我和JPEG来说都是行之有效的,因为它是PageSpeed Insights的安全方面。
File > Save for Web & Devices 文件>保存用于Web和设备
Not only do you need to find the right compression settings but also you need to stick to your img
tag actual dimension. 您不仅需要找到正确的压缩设置,还需要坚持
img
标签的实际尺寸。 If you know your max width for img
tag will be 555 px then save your JPEG to that dimension, not a pixel more ... as for how it goes along with retina display, it seems Google does not take this criteria in account right now. 如果您知道
img
标签的最大宽度为555像素,然后将JPEG保存为该尺寸,而不是再增加一个像素...至于其与视网膜显示的配合情况,看来Google目前未考虑此标准。
If you are not happy with the resulting quality (and you might be if you have a designer ecommerce site) you need to bypass Google recommendation - knowing it could slightly penalize your SEO over someone else that actually stick to the rule. 如果您对最终的质量不满意(如果您拥有设计师电子商务网站,则可能会感到满意),则需要绕过Google的建议-知道它可能会对您的SEO稍有不利于实际上坚持这一规则的其他人。
Due to the small number of different colours that image seems to have, you'd probably get a much smaller image if you exported it as a gif, or png-8. 由于图像似乎只有少量的不同颜色,如果将其导出为gif或png-8,则可能会得到较小的图像。 Sitepoint has a useful article on when to choose which image format .
Sitepoint上有一篇有关何时选择哪种图像格式的有用文章 。
You don't mention if you are using the Chrome extension or the main website? 您没有提到使用的是Chrome扩展程序还是主要网站? Assuming the former you can actually download the optimised version of an image by clicking the 'See optimised content' link under 'Suggestions for this page'.
假设是前者,您实际上可以通过单击“此页面的建议”下的“查看优化的内容”链接来下载图像的优化版本。
Img here: 在这里:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.