Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2018-06-25 15:00 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (127 votes). Check out past polls.