PHP | Gmagick borderImage() Function Last Updated : 08 Feb, 2022 Comments Improve Suggest changes Like Article Like Report The Gmagick::borderImage() function is an inbuilt function in PHP which is used to draw the border in an image. This function creates the border surrounding the image in the given color. Syntax: Gmagick Gmagick::borderImage( $bordercolor, $width, $height ) Parameters: This function accepts three parameters as mentioned above and described below: $bordercolor: This parameter holds a string containing the border color. $width: This parameter is used to set the border width. $height: This parameter is used to set border height. Return Value: This function returns Gmagick object on success. Below programs illustrate the Gmagick::borderImage() function in PHP: Program 1: php <?php // Create an image object $image = new Gmagick ( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png'); // Set the border in the given image $image->borderImage('green', 100, 100); header("Content-Type: image/jpg"); // Display image echo $image; ?> Output: 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 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'); // Set the border in the given image $image->borderImage('green', 20, 20); header("Content-Type: image/jpg"); // Display image echo $image; ?> Output: Reference: http://php.net/manual/en/gmagick.borderimage.php Comment More infoAdvertise with us Next Article PHP | Gmagick borderImage() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP Image-Processing PHP-function PHP-Gmagick +1 More Similar Reads 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 | 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 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 blurimage() Function The Gmagick::blurimage() function is an inbuilt function in PHP which is used to add blur filter to the image. Syntax: Gmagick Gmagick::blurimage( $radius, $sigma, $channel )  Parameters: This function accepts three parameters as mentioned above and described below: $radius: This parameter is used 2 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