首页 > 解决方案 > 使用具有原始 FPS 的 imagemagick 调整动画 GIF 文件的大小

问题描述

我想调整动画 gif 文件的大小。我使用了以下命令:

 .\convert.exe "d:\example.gif" -resize 600x400 "d:\exampleResult.gif"

结果 gif 文件似乎比原始文件慢得多。更重要的是,当我在没有任何附加参数的情况下调用 convert 时,结果 gif 仍然比原来的慢:

.\convert.exe "d:\example.gif" "d:\exampleResult.gif"

如何使用原始 FPS 调整 gif 大小?

标签: imagemagickimagemagick-convert

解决方案


您可以使用获得两帧之间的当前延迟

identify -verbose example.gif | grep Delay.

这应该会给你类似的东西Delay: nx100,这意味着n/100原始 gif 中的两帧之间有 th 秒的延迟。

现在,如果您想拥有相同的帧速率,请按以下方式进行

convert -delay n example.gif example_new.gif

如果您希望帧速率更快,请使用

convert -delay m example.gif example_same.gif哪里m < n

反之亦然,帧速率较慢。

希望能帮助到你。


推荐阅读