Getting 1 pixel from each image made no difference: IM still made an 8MB temp file for each frame.
I run it with no other apps running. top reports it using 2-2.4 GB RAM, 64-80% - not all. 149 frames, 8 MB each: that's 1.2 GB: why does IM cache to disk?
ImageMagick tries to handle all frames of an animated GIF
-
- Posts: 15
- Joined: 2017-12-28T11:38:17-07:00
- Authentication code: 1152
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: ImageMagick tries to handle all frames of an animated GIF
You need enough room for the input and the output in RAM and any temp files that may be created. So I suspect you are running out of RAM.
-
- Posts: 15
- Joined: 2017-12-28T11:38:17-07:00
- Authentication code: 1152
Re: ImageMagick tries to handle all frames of an animated GIF
python-pillow's explode.py extracts individual frames in a jiffy; gifbuild returns a count quickly. I've solved my problem but not answered my question.
-
- Posts: 15
- Joined: 2017-12-28T11:38:17-07:00
- Authentication code: 1152
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: ImageMagick tries to handle all frames of an animated GIF
From what you've said, I can only think that the O/S is denying the memory requests. Have you tried "-debug all"?RandomTroll wrote:... why does IM cache to disk?
snibgo's IM pages: im.snibgo.com
-
- Posts: 15
- Joined: 2017-12-28T11:38:17-07:00
- Authentication code: 1152
Re: ImageMagick tries to handle all frames of an animated GIF
top reports that it's getting 2-2.4GB of RAM and there's still .6GB free. That should easily be enough to hold a 7MB input file and 149 8MB output files. I occasionally run other apps that use all my RAM.
There's a more important question: why does IM have to render every frame just to count them? to extract a single one? Even if it does it all in RAM, it's a waste.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: ImageMagick tries to handle all frames of an animated GIF
I don't know if this helps, but to get the number of frames, you can do (on Unix)
The -ping avoids reading the pixel data and just reads from the header, if the information is in the header.
Code: Select all
convert rose: rose: rose: rose.gif
Code: Select all
identify -ping -format "%n\n" rose.gif | head -n 1
3