realy slow to create animated gif

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bbunlock
Posts: 8
Joined: 2006-06-04T08:39:46-07:00
Location: England

realy slow to create animated gif

Post by bbunlock »

I have a script that creates an amimated gif with text effects (Zoom And Fade), now the problem is that it takes around one and a half minutes for the script to create the animated gif.

what I would like is for someone else to use this script on there web site to see how long it takes to create the gif, or if you can see somthing in the script that would improve upon the time taken to create the gif.

now I cant see an attachment option for this topic so I have posted the script to my site as a txt file so you can see the code.

here is the link to the script http://www.cellmind.com/generator/script.txt just save it as php or copy and paste from web browser

here is a link to the original jpg image that this script uses http://www.cellmind.com/generator/test.jpg

here is a link to the font that was used in this script http://www.cellmind.com/generator/Chinese.ttf

here is a link to a screensaver that was created using this script and the files above http://www.cellmind.com/generator/test.gif

you have everything I do to create the gif animation shown in the link above, now as I said my main concern is the fact it takes at least 1 minute for it to run the script and create the image and in some cases over one and a half minutes, some things I believe are of note are

1, the screensaver will be created at 240x320 (size of the test.jpg image)

2, the script creates png files for the text effect and those png files for some reason are huge, when I opened one of the png files in adobe and then saved it as a new png (24) in adobe it was a fraction of the imagemagik file size

3, my server is a duel xeon server with 1 gig ram

if you manage to execute this script a lot faster than me then I would realy appriciate if you could tell me how you did it.

==== EDIT ====

I have just realised I have hotlink protection on my site so when you click the links you go to my home page instead, quick solve just have my home page open and then copy a link at a time into the address bar and press enter, then it works as your doing it from my site

regards

wayne
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: realy slow to create animated gif

Post by fmw42 »

Your script is rather complicated and long and I don't do PHP with IM well. But things to consider:

1) If you are on a Q16 IM, then you can add -depth 8 to make 8-bit per channel color

2) You could make your images 8bits total color using PNG8:filename

3) I am not sure what is faster, -draw, -annotate, label or caption. But you could try the others as I see you are using -draw somewhere in your script.

See Anthony's pages about creating text and about animations and optimizations and image formats at http://www.imagemagick.org/Usage/
Post Reply