【问题标题】:Batch resizing animated gifs批量调整动画 GIF 的大小
【发布时间】:2015-09-18 07:55:04
【问题描述】:

如何使用 imagemagick 批量调整动画 GIF 的大小?我有这个适用于单个图像的脚本,但我必须同时指定确切的图像名称。

convert {path to image with filename}.gif -coalesce -resize 200x200 \
        -layers optimize-frame {output name}.gif

mogrify -path 似乎是批处理,但动画都被 mogrify 破坏了。

【问题讨论】:

    标签: php image image-processing imagemagick


    【解决方案1】:

    你没有说你使用的是 OS X、Linux 还是 Windows,但如果在前两者中的任何一个上并使用 bash,你可以使用循环:

    for f in CurrentLocation/*.gif; do convert "$f" -coalesce -resize... -layers... NewLocation/$(basename "$f"); done
    

    如果你不幸不得不使用 Windows,它看起来像这样:

    FOR %%G IN (SOMEWHERE/*.GIF) DO convert "%%G" -set filename:new "%f" -coalesce -resize... -layers... "elsewhere/%[filename:new]"
    

    【讨论】:

      猜你喜欢
      • 2018-04-18
      • 2011-11-01
      • 2012-09-07
      • 1970-01-01
      • 2011-02-23
      • 2012-04-16
      • 2011-08-09
      • 2011-08-31
      • 1970-01-01
      相关资源
      最近更新 更多