PHP | Gmagick charcoalimage() Function Last Updated : 18 Nov, 2019 Comments Improve Suggest changes Like Article Like Report The Gmagick::charcoalimage() function is an inbuilt function in PHP which is used to rotate an image with given degrees. After rotating the image, empty triangles left which are filled with the background color. Syntax: Gmagick Gmagick::charcoalimage( $color, $degree) Parameters: This function accepts two parameters as mentioned above and described below: $color: This parameter holds the background color. $degree: This parameter holds the degree of rotation of image. Return Value: This function returns Gmagick object on success. Errors/Exceptions: This function throws GmagickException on error. Below programs illustrate the Gmagick::charcoalimage() function in PHP: Program 1: Original Image: php <?php // Create a Gmagick object $gmagick = new Gmagick( 'https://media.geeksforgeeks.org/wp-content/uploads/tech.png'); // Use charcoalimage() function $gmagick->charcoalimage(10, 13); header('Content-type: image/png'); // Output the image echo $gmagick; ?> Output: Program 2: php <?php // Create a GmagickDraw object $draw = new GmagickDraw(); // Create GmagickPixel object $strokeColor = new GmagickPixel('Red'); $fillColor = new GmagickPixel('Green'); // Set the color, opacity of image $draw->setStrokeOpacity(1); $draw->setStrokeColor('Red'); $draw->setFillColor('Green'); // Set the width and height of image $draw->setStrokeWidth(7); $draw->setFontSize(72); // Function to draw circle $draw->circle(250, 250, 100, 150); $gmagick = new Gmagick(); $gmagick->newImage(500, 500, 'White'); $gmagick->setImageFormat("png"); $gmagick->drawImage($draw); // Use charcoalimage() function $gmagick->charcoalimage(15, 23); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/gmagick.charcoalimage.php/a> Comment More infoAdvertise with us Next Article PHP | Gmagick charcoalimage() Function S sarthak_ishu11 Follow Improve Article Tags : Web Technologies PHP Image-Processing PHP-function PHP-Gmagick +1 More Similar Reads PHP | Imagick charcoalImage() Function The Imagick::charcoalImage() function is an inbuilt function in PHP which is used to simulate a charcoal drawing of an image. Syntax: bool Imagick::charcoalImage( $radius, $sigma ) Parameters: This function accepts two parameters as mentioned above and described below: $radius: This parameter stores 1 min read PHP | Gmagick chopimage() Function The Gmagick::chopimage() function is an inbuilt function in PHP which is used to remove the region of an image and trim it. This function accepts the dimension of image and chops the area and the dimension from where the image is to be trim.Syntax:Â Â Gmagick Gmagick::chopimage( $width, $height, $x, 2 min read PHP | Gmagick cropimage() Function The Gmagick::cropimage() function is an inbuilt function in PHP which is used to extracts the region of the image. This function crop the part of image. Syntax: public Gmagick::cropimage( $width , $height , $x , $y ) Parameters: This function accept four parameters as mention above and describe belo 2 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 enhanceimage() Function The Gmagick::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:Â Â Gmagick Gmagick::enhanceimage( void ) Parameters: This function does not accepts any parameter.Return Value: 1 min read Like