Reputation: 479
I have a directory with a lot of png files with the next structure:
image1.png
image2.png
...
image3372.png
I am trying to create a GIF image with ImageMagick, so in a Terminal I am typing:
sudo apt-get install imagemagick
convert -delay 0.01 -loop 0 *.png myimage.gif
But I have the next errors:
...
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).
And the GIF created is not complete:
Also, it blinks. I think it is because it is considering image18 and image180 as consecutive. How do I fix that?
I am running Ubuntu 18
Edit:
New Image generated by xenoid suggestions
Upvotes: 4
Views: 3234
Reputation: 8914
*.png
is expanded and sorted alphabetically by your shell,so if you want frames in their number sequence, pad the names with 0's:for n in {1..3372} ; ; do mv image$n.png image$(printf "%04d" $n).png ; done
convert
(and other IM commands) uses a memory cache and has several self-enforced limits (that you can list with IM's identify
command):>>> 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 ...
/etc/ImageMagick-6/policy.xml
and look for lines such as <policy domain="resource" name="memory" value="256MiB"/>
and increase the necessary ones.Upvotes: 2