我有一个目录,其中包含许多具有以下结构的png文件:
image1.png
image2.png
...
image3372.png
我正在尝试使用ImageMagick创建GIF图像,因此在终端中输入:
sudo apt-get install imagemagick
convert -delay 0.01 -loop 0 *.png myimage.gif
但是我有下一个错误:
...
convert-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c
/ConnectPixelCacheServer/244.
convert-im6.q16: cache resources exhausted `Image119.png' @ error/cache.c/OpenPixelCache/3984.
convert-im6.q16: too many exceptions (exception processing suspended).
而且,它闪烁。我认为这是因为它将image18和image180视为连续的。我该如何解决?
我正在运行Ubuntu 18
*.png
由您的外壳展开并按字母顺序排序,因此,如果要按编号顺序排列帧,请用0填充名称:for n in {1..3372} ; ; do mv image$n.png image$(printf "%04d" $n).png ; done
[
convert
(和其他IM命令)似乎使用了内存缓存,并具有其他强制实施的限制(可以使用IM的identify
命令列出):
>>> identify -list resource
Resource limits:
Width: 16KP
Height: 16KP
List length: 18.446744EP
Area: 128MP
Memory: 256MiB
Map: 512MiB
Disk: 1GiB
File: 768
Thread: 8
Throttle: 0
Time: unlimited
您可以提高一次运行的限制:
convert -limit memory 1000 ...