linux - 使用 ImageMagick : too many exceptions and blinking problem 创建 GIF 图像时出错

标签 linux image terminal imagemagick gif

我有一个包含大量 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).

并且创建的 GIF 不完整:
enter image description here

此外,它会闪烁。我认为这是因为它将 image18 和 image180 视为连续的。我该如何解决?

我正在运行 Ubuntu 18

编辑:
由 xenoid 建议生成的新图像
enter image description here

最佳答案

  • 100 帧/秒是矫枉过正。您可以以 10 帧/秒的速度运行并将图像计数除以 10(或至少标准的 25 帧/秒并除以 4)。
  • *.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  ...
    

    关于linux - 使用 ImageMagick : too many exceptions and blinking problem 创建 GIF 图像时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60987165/

    相关文章:

    amazon-web-services - 如何从命令行访问 Amazon S3 上的文件?

    c - 使用 struct ip 和 struct iphdr 取消引用指向不完整类型的指针

    c - 如何在 Linux 2.6.29 中解码 ioctl() 系统调用中的 arg 指针?

    image - R-像素矩阵的图像?

    html - 尝试将网站背景从黑色更改为图像

    node.js - Mac 终端中的 Node 。 3 个点不断出现,如 '...'

    linux - 如何通过 Windows 7 PC 的共享 Internet 连接 (ICS) 将嵌入式设备连接到 Internet?

    linux - SpreeCommerce Git 错误我不知道为什么会出现这个错误

    javascript - 如何用 Angular 刷新图像

    c - 需要帮助了解如何使用 get char 在终端中输入句子