gif优化_优化GIF

gif优化

I've written a lot about converting different media types lately, especially GIFs, including Convert Video to GIF or GIF to VideoDetect if a GIF is Animated, and Get the First Frame of an Animated GIF with ImageMagick, but whether it's ImageMagick or ffmpeg doing the work, GIFs do not always come out optimized.  Since GIFs can be taxing on the user's machine, it's best to optimize GIFs for top performance.  Another handy GIF manipulation library, gifsicle, has a few built in methods for optimizing GIFs.

最近,我写了很多有关转换不同媒体类型的文章,特别是GIF,包括将Video转换为GIF或GIF转换为Video检测GIF是否为动画 ,以及使用ImageMagick获取动画GIF的第一帧 ,但无论它是ImageMagick还是ffmpeg做这项工作时,GIF并非总是经过优化。 由于GIF可能会给用户的机器增加负担,因此最好针对最佳性能优化GIF。 另一个方便的GIF操作库gifsicle具有一些用于优化GIF的内置方法。

Before jumping into the GIF optimization commands, it's important to point out that gifsicle is much more than a GIF optimizer.  gifsicle can resize GIFs, merge GIFs, and do just about anything you'd hope you could do with a GIF.

在进入GIF优化命令之前,必须指出gifsicle不仅仅是GIF优化器。 gifsicle可以调整GIF的大小,合并GIF并执行您希望使用GIF可以做的几乎所有事情。

gifsicle has three types of GIF optimization to choose from:

gifsicle有三种类型的GIF优化可供选择:

  • -O1 Stores only the changed portion of each image. This is the default.

    -O1仅存储每个图像的更改部分。 这是默认值。

  • -O2 Also uses transparency to shrink the file further.

    -O2还使用透明度来进一步缩小文件。

  • -O3 Try several optimization methods (usually slower, sometimes better results).

    -O3尝试几种优化方法(通常速度较慢,有时效果更好)。

The shell command to optimize GIFs is:

用于优化GIF的shell命令为:


gifsicle -O3 animation.gif -o animation-optimized.gif


If you have the time and patience, I recommend -O3 as was able to get much more optimized GIFs with this method.  On some GIFs I saved up to 20% in file size, and depending on your specific GIF, you may be able to save more!

如果您有时间和耐心,我建议使用-O3因为它可以使用此方法获得更多优化的GIF。 在某些GIF上,我最多可以节省20%的文件大小,并且取决于您的特定GIF,您也许可以保存更多!

翻译自: https://davidwalsh.name/optimize-gifs

gif优化

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值