Created
December 10, 2008 14:51
-
-
Save mgng/34340 to your computer and use it in GitHub Desktop.
create gif animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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