使用 PHP 压缩图像
我通过 php 处理上传的图像,并通过 imagejpeg
保存(调整大小后)。正如我所探索的,imagejpeg
是压缩 jpg 图像以减小文件大小的最佳 php 命令。然而,当我通过 Google Page Speed 检查我的网站时,它说我的所有图像都可以压缩 4-10%。
压缩图像以满足Google标准的常用方法是什么?
I process uploaded images by php to save (after resize) by imagejpeg
. As I explored, imagejpeg
is the best php command to compress jpg images to reduce the file size. However, when I check my website by Google Page Speed, it says all of my images can be compressed 4-10%.
What is the common method to compress images to meet the Google standard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谷歌的“标准”是谷歌所期望的可能的最大值。您需要使用高度优化的图像压缩器,该压缩器除了图像压缩之外不执行其他任何操作,因此在这里获得可能的最大最佳值。
例如,您可以在 adobe photoshop 等图像编辑器中打开 jpeg 文件,并在进行视觉控制的同时创建您期望的最大最佳压缩率。强烈推荐。
GD 库提供了标准的 jpeg 压缩,该压缩应符合库用户的期望,但可能无法满足图形设计师(和/或 google 4-10%)。
Googles "standard" is the possible maximum to be expected by google. You need to use highly optimized image compressors that does nothing else than image compressing and therefore get a possible maximum best value here.
You can for example, open you jpeg file in a image editor like adobe photoshop and create the possible maximum best compression to be expected by you while having visual control. Highly recommended.
The GD library provides a standard conform jpeg compression which should match a library users expectation, but which might not satisfy a graphic designer (and/or google by 4-10%).