to create an animation gif from filelist using addImage
<?php
$filelist = array("fileitem1.png","fileitem2.png","fileitem3.png");
$aniGif = new Imagick();
$aniGif->setFormat("gif");
foreach($filelist as $frameitem){
echo "-----------------------\n adding frame {$frameitem}\n";
$frame = new Imagick($frameitem);
$aniGif->addImage($frame);
//$delay time unit is micro second so 100 = 1s, one picture per second
$aniGif->setImageDelay($delay = 100);
echo "end of adding frame {$frameitem}\n";
}
//there more than one file, so must be using writeImages()
$aniGif->writeImages($fileTarget = "aniGif.gif", $adjoin = true);
?>
Imagick::addImage
(PECL imagick 2.0.0)
Imagick::addImage — Adds new image to Imagick object image list
Description
Warning
This function is currently not documented; only its argument list is available.
Adds new image to Imagick object from the current position of the source object. After the operation iterator position is moved at the end of the list.
Parameters
- source
-
The source Imagick object
Return Values
Returns TRUE on success.
Errors/Exceptions
Throws ImagickException on error.
Imagick::addImage
fortruth at mabang dot net
25-May-2010 05:21
25-May-2010 05:21
