PHP | Gmagick levelimage() Function Last Updated : 21 Jan, 2020 Comments Improve Suggest changes Like Article Like Report The Gmagick::levelimage() function is an inbuilt function in PHP which is used to adjust the levels of an image by scaling the colors falling between specified white and black points to the full available quantum range. Syntax: mixed Gmagick::levelimage( float $blackPoint, float $gamma, float $whitePoint, int $channel = Gmagick::CHANNEL_DEFAULT ) Parameters: This function accept four parameters as mentioned above and described below: $blackPoint: It specifies the image black point. $gamma: It specifies the image gamma. $whitePoint: It specifies the image white point. $channel (Optional): It specifies any channel constant that is valid for the channel mode. Return Value: This function returns TRUE on success. Exceptions: This function throws GmagickException on error. Below given programs illustrate the Gmagick::levelimage() function in PHP: Used Image: Program 1 (Level an image): php <?php // Create a new Gmagick object $gmagick = new Gmagick('geeksforgeeks.png'); // Level the image $gmagick->levelimage(300000, 8, 10); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Program 2 (Level an drawing): php <?php // Create a new Gmagick object $gmagick = new Gmagick('geeksforgeeks.png'); // Create a GmagickDraw object $draw = new GmagickDraw(); // Set the color $draw->setFillColor('white'); // Function to draw rectangle $draw->rectangle(0, 0, 800, 400); // Set the fill color $draw->setFillColor('red'); // Set the font size $draw->setfontsize(50); // Annotate a text $draw->annotate(30, 100, 'GeeksforGeeks'); // Use of drawimage function $gmagick->drawImage($draw); // Level the image $gmagick->levelimage(0, 34, 30); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/gmagick.levelimage.php Comment More infoAdvertise with us Next Article PHP | Gmagick levelimage() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Gmagick Similar Reads PHP | Imagick levelImage() Function The Imagick::levelImage() function is an inbuilt function in PHP that is used to adjust the levels of an image. Syntax: bool Imagick::levelImage( $blackPoint, $gamma, $whitePoint, $channel = Imagick::CHANNEL_DEFAULT ) Parameters: This function accepts four parameters as mentioned above and describe 1 min read PHP | Gmagick labelimage() Function The Gmagick::labelimage() function is an inbuilt function in PHP which is used to label to the image. A label is just a string attached to an image which can be extracted back later from the image. This label is not visible on the image itself but you can do so using annotate function. Syntax: mixed 2 min read PHP | Gmagick implodeimage() Function The Gmagick::implodeimage() function is an inbuilt function in PHP which is used to creates a new image that is a copy of existing image. It uses the image pixels imploded by the specified percentage.Syntax:  mixed Gmagick::implodeimage( $radius ) Parameters: This function accepts a single paramete 1 min read PHP | Imagick newImage() Function The Imagick::newImage() function is an inbuilt function in PHP which is used to creates a new image. This function creates a new image and associates ImagickPixel value as the background color. Syntax: bool Imagick::newImage( $cols, $rows, $background, $format ) Parameters: This function accepts fo 1 min read PHP | Gmagick minifyimage() Function The Gmagick::minifyimage() function is an inbuilt function in PHP which is used to scale an image proportionally to half of its original size. This function resizes the image into one-half of its original size.Syntax:  Gmagick Gmagick::minifyimage( void ) Parameters: This function does not accepts 1 min read Like