The Wayback Machine - https://web.archive.org/web/20230421175258/https://www.geeksforgeeks.org/php-imagick-addimage-function/
Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

PHP | Imagick addImage() Function

Improve Article
Save Article
Like Article
author
sarthak_ishu11
scholar
483 published articles
Improve Article
Save Article
Like Article

The Imagick::addImage() function is an inbuilt function in PHP which is used to adds new image to Imagick object image list. After the operation iterator position is moved at the end of the list. This function adds new image to Imagick object from the current position of the source object. The Imagick class have the ability to hold and operate on multiple images simultaneously.

Syntax:

bool Imagick::addImage ( $source )

Parameters: This function accepts single parameter $source which holds the source Imagick object.

Return Value: This function returns TRUE on success.

Errors/Exceptions: This function throws ImagickException on error.

Below programs illustrate the Imagick::addImage() function in PHP:
Original Image 1:
adpative thresold image

Original Image 2:
original image

Program:




<?php 
  
// require_once('path/to/vendor/autoload.php');
  
header('Content-type: image/png');
  
$image = new Imagick(
  
$t = new Imagick(
  
$image->addImage($t);
  
echo $image;
?>

Last Updated : 26 Aug, 2019
Like Article
Save Article
Similar Reads
Related Tutorials