downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Imagick::addNoiseImage> <Imagick::adaptiveThresholdImage
[edit] Last updated: Fri, 17 May 2013

view this page in

Imagick::addImage

(PECL imagick 2.0.0)

Imagick::addImageAdds new image to Imagick object image list

Descrizione

bool Imagick::addImage ( Imagick $source )

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.

Elenco dei parametri

source

The source Imagick object

Valori restituiti

Restituisce TRUE in caso di successo.

Errori/Eccezioni

Lancia una ImagickException in caso di errore.



add a note add a note User Contributed Notes Imagick::addImage - [2 notes]
up
0
bernie at dakotanetwork dot com
1 year ago
create a favicon.ico with multiple resolutions

<?php

$src_img
= new Imagick("src_img.png");
$icon = new Imagick();
$icon->setFormat("ico");

$geo=$src_img->getImageGeometry();

$size_w=$geo['width'];
$size_h=$geo['height'];

if (
128/$size_w*$size_h>128) {
 
$src_img->scaleImage(128,0);
} else {
 
$src_img->scaleImage(0,128);
}

$src_img->cropImage(128, 128, 0, 0);

$clone = $src_img->clone();
$clone->scaleImage(16,0);           
$icon->addImage($clone);

$clone = $src_img->clone();
$clone->scaleImage(32,0);           
$icon->addImage($clone);

$clone = $src_img->clone();
$clone->scaleImage(64,0);           
$icon->addImage($clone);

$clone = $src_img->clone();
$clone->scaleImage(128,0);   
$icon->addImage($clone);

$icon->writeImages("favicon.ico", true);

$src_img->destroy();
$icon->destroy();
$clone->destroy();

?>
up
-3
fortruth at mabang dot net
2 years ago
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);
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites