Skip to content

Instantly share code, notes, and snippets.

@mgng
Created December 10, 2008 14:51
Show Gist options
  • Save mgng/34340 to your computer and use it in GitHub Desktop.
Save mgng/34340 to your computer and use it in GitHub Desktop.
create gif animation
<?php
// create animation gif
function animate($fileList, $delay, $out){
$img = new Imagick();
$img->setFormat('gif');
foreach($fileList as $file) {
$tmp = new Imagick($file);
$tmp->setFormat('gif');
$tmp->setImageDelay($delay);
$img->addImage($tmp);
$tmp->destroy();
}
$img->writeImages($out, true);
$img->destroy();
}
animate(array('a.jpg', 'b.gif', 'c.png'), 30, 'out.gif');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment