PHP | Imagick drawImage() Function Last Updated : 26 Jul, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::drawImage() function is an inbuilt function in PHP which is used to render the ImagickDraw object on the Imagick object. It is used to draw the image on the Imagick instance. We set an image matrix, parameters and the borders of the drawn image with the help of ImagickDraw methods and then render it using Imagick::drawImage() function. Syntax: bool Imagick::drawImage( ImagickDraw $draw ) Parameters: This function accepts single parameter $draw which holds the ImagickDraw instance to get the details about the image that is to be rendered on the screen. Return Value: It returns True value when it is executed successfully. Program: This program creates an image, set its dimensions and border properties and then render it on the screen. PHP <?php // Declare a string which to be drawn $geek = "GeeksforGeeks"; // Declare an Imagick object $image = new Imagick(); // Declare an ImagickDraw object $draw = new ImagickDraw(); // Set the color of Imagickdraw object $draw->setFillColor(new ImagickPixel('Green')); // Set the font size of text $draw->setFontSize(120); // Array representing the font metrics $metrix = $image->queryFontMetrics($draw, $geek); // Set the position of text with respect // to the border $draw->annotation(0, 100, $geek); // Create image of given size $image->newImage(875, 150, new ImagickPixel('white')); // Use drawImage() function to draw the image $image->drawImage($draw); // Set the border of image $image->borderImage(new ImagickPixel('green'), 5, 5); // Set the image format $image->setImageFormat('png'); header('Content-type: image/png'); // Display the image echo $image; ?> Output: Reference: https://www.php.net/manual/en/imagick.drawimage.php Comment More infoAdvertise with us Next Article PHP | Imagick drawImage() Function P piyush25pv Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick 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 | Imagick cropImage() Function The Imagick::cropImage() function is an inbuilt function in PHP which is used to extracts the region of the image.Syntax:  int Imagick::cropImage( $width, $height, $x, $y ) Parameters: This function accept four parameters as mention above and describe below.  $width: This parameter is used to spec 2 min read PHP | Imagick borderImage() Function The Imagick::borderImage() function is an inbuilt function in PHP which is used to draw the border in an image. This function creates the border surrounded to the image in the given color. Syntax: bool Imagick::borderImage( $bordercolor, $width, $height ) Parameters: This function accepts three para 1 min read PHP | Imagick displayImage() Function The Imagick::displayImage() function is an inbuilt function in PHP which is used to displays an image object. Syntax: bool Imagick::displayImage( $servername ) Parameters: This function accepts a single parameter $servername which is used to specify the server name. Return Value: This function retur 1 min read PHP | Imagick displayImages() Function The Imagick::displayImages() function is an inbuilt function in PHP which is used to display an image or images sequence on an X server. Syntax: bool Imagick::displayImages( string $servername ) Parameters: This function accepts single parameter $servername which holds the X server name. Return Valu 1 min read Like