PHP | Imagick displayImage() Function Last Updated : 10 Jan, 2022 Comments Improve Suggest changes Like Article Like Report 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 returns True on success. Below programs illustrate the Imagick::displayImage() function in PHP: Program: php <?php // Create an Imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png'); // Use displayImage function $imagick->displayImage(5); header("Content-Type: image/jpg"); // Display the output image echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php $string = "Computer Science portal for Geeks!"; // creating new image of above String // and add color and background $im = new Imagick(); $draw = new ImagickDraw(); // Fill the color in image $draw->setFillColor(new ImagickPixel('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 ImagickPixel('white')); // Draw the image $im->drawImage($draw); $im->setImageFormat('jpeg'); header("Content-Type: image/jpg"); // Display the output image echo $im->getImageBlob(); ?> Output: Reference: http://php.net/manual/en/imagick.displayimage.php Comment More infoAdvertise with us Next Article PHP | Imagick displayImage() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP Image-Processing PHP-function PHP-Imagick +1 More Similar Reads 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 PHP | Imagick drawImage() Function 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 t 2 min read 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 decipherImage() Function The Imagick::decipherImage() function is an inbuilt function in PHP which is used to decipher an image which has been enciphered before. Syntax: bool Imagick::decipherImage( string $passphrase ) Parameters: This function accepts a single parameter $passphrase which holds the passphrase value or the 1 min read PHP | Imagick flopImage() Function The Imagick::flopImage() function is an inbuilt function in PHP which is used to create a horizontal mirror image. Syntax: bool Imagick::flopImage( void ) Parameters: This function does not accept any parameter. Return Value: This function returns True on success. Below programs illustrate the Imagi 1 min read Like