PHP | Gmagick addImage() Function Last Updated : 10 Jan, 2022 Comments Improve Suggest changes Like Article Like Report The Gmagick::addImage() function is an inbuilt function in PHP which is used to adds new image to Gmagick object image list. This function adds a new image to Gmagick object from the current position of the source object. The Gmagick class have the ability to hold and operate on multiple images simultaneously. Syntax: bool Gmagick::addImage( $source ) Parameters: This function accepts a single parameter $source which holds the source Gmagick object. Return Value: This function returns Gmagick object on success. Errors/Exceptions: This function throws GmagickException on error. Below programs illustrate the Gmagick::addImage() function in PHP: Original Image 1: Program: php <?php // require_once('path/to/vendor/autoload.php'); header('Content-type: image/png'); $image = new Gmagick ( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png'); $t = new Gmagick ( 'https://media.geeksforgeeks.org/wp-content/uploads/adaptiveThresholdImage.png'); $image->addImage($t); echo $image; ?> Output: Original Image 2: Program 2: php <?php $string = "Computer Science portal for Geeks!"; // Creating new image of above String // and add color and background $im = new Gmagick(); $draw = new GmagickDraw(); // Fill the color in image $draw->setFillColor(new GmagickPixel('green')); // Set the text font size $draw->setFontSize(50); $matrix = $im->queryFontMetrics($draw, $string); $draw->annotation(0, 40, $string); $im->newImage($matrix['textWidth'], $matrix['textHeight'], new GmagickPixel('white')); // Draw the image $im->drawImage($draw); $im->setImageFormat('jpeg'); $t = new Gmagick ( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png'); $im->addImage($t); header("Content-Type: image/jpg"); echo $im->getImageBlob(); ?> Output: Reference: http://php.net/manual/en/gmagick.addimage.php Comment More infoAdvertise with us Next Article PHP | Gmagick addImage() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP Image-Processing PHP-function PHP-Gmagick +1 More Similar Reads PHP | Imagick addImage() Function 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 Imagi 1 min read PHP | Gmagick drawimage() Function The Gmagick::drawimage() function is an inbuilt function in PHP which is used to render the GmagickDraw object on the current image. Syntax: Gmagick Gmagick::drawimage ( $GmagickDraw ) Â Parameters: This function accepts a single parameters as $GmagickDraw which stores the operations to render the i 2 min read PHP | Gmagick addnoiseimage() Function The Gmagick::addnoiseimage() function is an inbuilt function in PHP which is used to add noise in given image. The intensity of noise depends on noise constants and channel types. The image noise is the random variation of brightness and contrast in an image. Syntax:Â Gmagick Gmagick::addnoiseimage 2 min read PHP | Gmagick edgeimage() Function The Gmagick::edgeimage() function is an inbuilt function in PHP which is used to enhance the image edges using convolution filter of the given radius. Radius 0 is used as auto-selected.Syntax:Â Â Gmagick Gmagick::edgeimage( $radius ) Parameters: This function accepts a single parameter as $radius whi 1 min read PHP | Gmagick frameimage() Function The Gmagick::frameimage() function is an inbuilt function in PHP which is used to add a simulated three-dimensional border around the image. The width and height specify the border width of the vertical and horizontal sides of the frame. The inner and outer bevels indicate the width of the inner and 2 min read Like