图像优化需求
我使用 100pulse.com 等工具测试了我的网站加载性能,这些工具显示由于图像优化不当,我的网站加载时间异常长。谁能建议良好的图像优化技术来提高我的网站响应时间?
I tested my website load performance using tools like 100pulse.com that show my website took unusual time to load because of improper image optimization. Can anyone suggest good image optimization technique to improve my website response time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
图像优化
图像压缩分为有损和无损:有损压缩会丢弃原始文件中的信息,而无损压缩会保留所有原始数据(但文件大小往往会更大)。
通过有选择地减少图像中的颜色数量,存储数据所需的字节数更少。这种效果几乎是看不见的,但它对文件大小产生了很大的影响! 因此,这会缩短页面下载时间
有多种图像压缩算法采用不同的方法来减小文件大小,下面列出的工具利用其中的一些工具来最小化图像的大小。
TinyPNG (https://tinypng.com/)
TinyPNG 使用智能有损压缩技术来减少PNG 文件的文件大小。
或
TinyJPG (https://tinyjpg.com/)
对于 JPG 文件
参考: http://websitespeedoptimizations.com/ImageOptzPost.aspx
Image Optimization
Image compression is either lossy or lossless: Lossy works by discarding information from the original file, and lossless retains all the original data (though, the file size tends to be bigger).
By selectively decreasing the number of colors in the image, fewer bytes are required to store the data. The effect is nearly invisible but it makes a very large difference in file size! Therefore this results in quicker page download times
There's a variety of image compression algorithms that take different approaches to reducing file size, and the tools listed below utilize a number of those to minimize the size of your images.
TinyPNG (https://tinypng.com/)
TinyPNG uses smart lossy compression techniques to reduce the file size of your PNG files.
OR
TinyJPG (https://tinyjpg.com/)
For JPG Files
Reference: http://websitespeedoptimizations.com/ImageOptzPost.aspx
您可以使用此Smushit来优化您的图像,它们会缩小尺寸而不损害质量。
http://developer.yahoo.com/yslow/smushit/
他们给了你一个更长的解释为什么它很酷,它在我开发一些手机游戏和 Flash 应用程序时确实对我很有帮助。
You could use this Smushit to optimize your images, they drop down their size without damaging the quality.
http://developer.yahoo.com/yslow/smushit/
They give you a longer explanation about why it is cool, it really helped me while working on some mobile games and flash apps.
给图像一些猛烈的爱。
“sips -s formatOptions 60 图像/路径”
对于图像/路径,您也可以将图像拖入。
您还可以尝试调整图像大小以节省速度
“sips -Z 800 图像/路径”
宽高比
此代码将保持非技术解决方案的
TinyPNG (https://tinypng.com/)
高级用户试用 (guetzli) 可能需要几分钟来优化一张图片,但它真的很好。
Give the image some bash love.
"sips -s formatOptions 60 image/path"
for image/path, you can also just drag the image in.
you can also try to resize the image to save speed
"sips -Z 800 image/path"
this code will keep the aspect ration
for a nontech solution
TinyPNG (https://tinypng.com/)
advanced users try out (guetzli) it can take several minutes to optimize one image but its really good.