Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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"); }
~~David~~

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
      ~~David~~

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2015-07-30 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls