Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Image::Magick GIF Animation Speed

by ~~David~~ (Hermit)
on Nov 23, 2007 at 19:25 UTC ( #652638=perlquestion: print w/ replies, xml ) Need Help??
~~David~~ has asked for the wisdom of the Perl Monks concerning the following question:

All, I am making an animated GIF, and want to be better able to control the speed at which it loops. Is there a setting somewhere that can accomplish this? Or do I have to make a 4 file loop with the first 2 and last 2 images being the same to slow down the apparent blink rate?
sub makeGIF { my $desktop = "C:\\Documents and Settings\\$ENV{LNAME}\\Desktop\\" +; my($blinker); $blinker = new Image::Magick; $blinker->Read("TempImages\\defective.bmp"); $blinker->Read("TempImages\\reference.bmp"); $blinker->Write("$desktop\\blink.gif"); }

Comment on Image::Magick GIF Animation Speed
Download Code
Replies are listed 'Best First'.
Re: Image::Magick GIF Animation Speed
by Sixtease (Friar) on Nov 23, 2007 at 20:34 UTC
    $blinker->Write(delay => $hundredths_of_second, filename => "$desktop\\blink.gif");

    I read in the tutorials that I encountered googling this up, that another option loop => 0 may be needed if you want the image to keep animating over and over. But as far as I tested it, the option doesn't make any difference.

      That works perfectly. I didn't need to add the loop option to make it repeat. Thanks, David

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://652638]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2015-12-01 06:16 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (795 votes), past polls