PHP | Imagick annotateImage() Function Last Updated : 26 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::annotateImage() function is an inbuilt function in PHP which is used to annotates an image with text. This function returns True on success. Syntax: bool Imagick::annotateImage( $draw_settings, $x, $y, $angle, $text ) Parameters: This function accepts five parameters as mentioned above and described below: $draw_settings: This parameter is used to create an ImagickDraw object that contains settings for drawing the text. $x: This parameter is set to horizontal offset in pixels to the left of text. $y: This parameter is set to vertical offset in pixels to the baseline of text. $angle: The angle at which to write the text. $text: The string which needs to draw. Return Value: This function returns True on success. Below programs illustrate the Imagick::annotateImage() function in PHP: Program 1: php <?php /* Create some objects */ $image = new Imagick(); $draw = new ImagickDraw(); $pixel = new ImagickPixel('white'); /* New image */ $image->newImage(800, 300, $pixel); /* Black text */ $draw->setFillColor('green'); /* Font properties */ $draw->setFont('Bookman-DemiItalic'); $draw->setFontSize( 30 ); /* Create text */ $image->annotateImage($draw, 30, 140, 0, 'GeeksforGeeks: A computer science portal'); /* Give image a format */ $image->setImageFormat('png'); /* Output the image with headers */ header('Content-type: image/png'); echo $image; ?> Output: Program 2: php <?php /* Create some objects */ $image = new Imagick(); $draw = new ImagickDraw(); $image = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png'); /* Black text */ $draw->setFillColor('green'); /* Font properties */ $draw->setFont('Bookman-DemiItalic'); $draw->setFontSize( 30 ); /* Create text */ $image->annotateImage($draw, 5, 120, 0, 'GeeksforGeeks: A computer science portal'); /* Give image a format */ $image->setImageFormat('png'); /* Output the image with headers */ header('Content-type: image/png'); echo $image; ?> Output: Related Articles: PHP | Imagick addNoiseImage() Function PHP | Imagick addImage() Function Reference: http://php.net/manual/en/imagick.annotateimage.php Comment More infoAdvertise with us Next Article PHP | Imagick annotateImage() Function V vijay_raj Follow Improve Article Tags : Misc Web Technologies PHP Image-Processing PHP-Imagick +1 More Practice Tags : Misc Similar Reads PHP | Gmagick annotateImage() Function The Gmagick::annotateImage() function is an inbuilt function in PHP which is used to annotates an image with text. This function returns True on success. Syntax: Gmagick Gmagick::annotateimage( $GmagickDraw, $x, $y, $angle, $text ) Parameters: This function accepts five parameters as mentioned above 2 min read PHP | Imagick enhanceImage() Function The Imagick::enhanceImage() function is an inbuilt function in PHP which is used to improve the quality of a noisy image. This function applies the digital filter to improve quality. Syntax: bool Imagick::enhanceImage( void ) Parameter: This function does not accepts any parameter. Return Value: Thi 1 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 averageImages() Function The Imagick::averageImages() function is an inbuilt function in PHP which is used to create an average of two or more images after image processing. It is well defined in PECL imagick 2.0.0 version. This function has been depreciated in further versions of Imagick hence it is replaced by Imagick::me 2 min read PHP | ImagickDraw annotation() Function The ImagickDraw::annotation() function is an inbuilt function in PHP which is used to draw the text on the image. Syntax: bool ImagickDraw::annotation( $x, $y, $text ) Parameters: This function accepts three parameters as mentioned above and described below: $x: This parameter is used to hold the va 3 min read Like