gif循环播放_防止动画GIF循环播放 系统管理员 2023-02-21 15:27 86阅读 0赞 gif循环播放 ![Prevent GIF Looping][] We all know animated GIFs put the "fun" in "functional." I've recently written incredible posts with regard to animated GIF images, including: 我们都知道动画GIF将“有趣”置于“功能”中。 我最近写过 难以置信 有关动画GIF图像的帖子,包括: * [Detect if a GIF is Animated][] [检测GIF是否为动画][Detect if a GIF is Animated] * [Merge GIFs with gifsicle][] [将GIF与Gificle合并][Merge GIFs with gifsicle] * [Optimize GIF Images][] [优化GIF图像][Optimize GIF Images] * [Convert Video to GIF or GIF to Video][] [将视频转换为GIF或将GIF转换为视频][Convert Video to GIF or GIF to Video] * [Get the First Frame of an Animated GIF with ImageMagick][] [使用ImageMagick获取动画GIF的第一帧][Get the First Frame of an Animated GIF with ImageMagick] One bit of information that has eluded me is how to control the loop count of an animated GIF. Say you have an animated GIF and you only want to limit the number of times the GIF can loop, or even prevent looping of the GIF -- it's super simple with gifsicle! 让我难忘的一点信息是如何控制动画GIF的循环计数。 假设您拥有动画GIF,而您只想限制GIF可以循环播放的次数,甚至可以防止GIF循环播放-gifsicle超级简单! ## 防止GIF循环 **(**Prevent GIF Looping**)** ## gifsicle provides a `--no-loopcount` option when you process a GIF: 当您处理GIF时,gifsicle提供了`--no-loopcount`选项: gifsicle herrera-wtf.gif --no-loopcount > herrera-wtf-once.gif The resulting GIF plays once and then stops: 产生的GIF播放一次,然后停止: ![Prevent GIF Looping][] *Click the image above to restart it*. *单击上面的图像以重新启动它* 。 ## 循环播放GIF \{x\}次 **(**Loop a GIF \{x\} Times**)** ## Another gifsicle command line option, `--loopcount`, allows for you to set any number as the loop count of the image: 另一个gifsicle命令行选项`--loopcount`允许您设置任何数字作为图像的循环计数: gifsicle jack-slow.gif --loopcount=3 > herrera-wtf-four-plays.gif The `--loopcount` is set to `3`, meaning the GIF actually plays 4 times (original, then 3 loops). `--loopcount`设置为`3` ,这意味着GIF实际上播放了4次(原始,然后是3个循环)。 Why you'd want a GIF to loop at any specific amount is unknown to me, but the ability to prevent looping is certainly useful, if only to cut down on how expensive the animation is! 我不知道为什么要让GIF以任何特定的大小循环播放,但是防止循环播放的功能肯定有用,即使只是为了减少动画的价格! > 翻译自: [https://davidwalsh.name/prevent-gif-loop][https_davidwalsh.name_prevent-gif-loop] gif循环播放 [Prevent GIF Looping]: http://imgconvert.csdnimg.cn/aHR0cHM6Ly9kYXZpZHdhbHNoLm5hbWUvZGVtby9oZXJyZXJhLXd0Zi1vbmNlLmdpZg [Detect if a GIF is Animated]: https://davidwalsh.name/detect-gif-animated [Merge GIFs with gifsicle]: https://davidwalsh.name/merge-gifs [Optimize GIF Images]: https://davidwalsh.name/optimize-gifs [Convert Video to GIF or GIF to Video]: https://davidwalsh.name/convert-video-gif [Get the First Frame of an Animated GIF with ImageMagick]: https://davidwalsh.name/first-frame-animated-gif [https_davidwalsh.name_prevent-gif-loop]: https://davidwalsh.name/prevent-gif-loop
还没有评论,来说两句吧...