Imagemagick 动画师在制作 gif 时不断调整我的图像大小

Imagemagick animator keeps resizing my images when making gif

这似乎是人们以前可能间接问过的问题,但我的问题更直接。

我有一个大小为 559x464 像素的图像文件夹。

[cbloecke@mac:cropped]% file file1_95w65w20n50n.png
file1_95w65w20n50n.png: PNG image data, 559 x 464, 8-bit/color RGBA, non-interlaced

所有 png 图像的文件名中都有相同的“95w”文本。我使用 imagemagick -loop 和 -delay 命令将它们制作成动画 gif。

convert *95w*.png -delay 30 -loop 0 animated_95w65w20n50n_t.gif

但每次我这样做时,生成的 gif 都会被调整得更大,周围有很多空白 space。

[cbloecke@mac:cropped]% file animated_95w65w20n50n_t.gif
animated_95w65w20n50n_t.gif: GIF image data, version 89a, 720 x 1080

我试过使用 -trim 和 -resize 559x464 来减小图像的大小,但它们没有任何作用。为什么 imagemagick 不断添加所有这些额外的 space?我如何 trim 将其恢复为原来的 559x464?

注意:我在无法控制已安装模块的网络上工作,因此我更喜欢 imagemagick 中的解决方案,或者可能是另一个默认 linux 模块。

打开图片后尝试重新分页,这样它们就会忘记之前的虚拟 canvas 尺寸:

convert *95w*.png +repage -delay 30 -loop 0 anim.gif