PHP | Imagick contrastImage() Function Last Updated : 31 Oct, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The Imagick::contrastImage() function is an inbuilt function in PHP which is used to change the contrast of the image. This function enhances the intensity differences between the lighter and darker elements of the image. Syntax: bool Imagick::contrastImage(bool $sharpen) Parameters: This function accepts a single parameter $sharpen which decides whether to increase or decrease the contrast. Return Value: This function returns True on success. Errors/Exceptions: This function throws ImagickException on error. Below given programs illustrate the Imagick::contrastImage() function in PHP: Program 1: php <?php // Create new Imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png'); // Apply the contrastImage() function $imagick->contrastImage(false); header("Content-Type: image/png"); // Display the output image echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create new Imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png'); // Apply the contrastImage() function $imagick->contrastImage(true); header("Content-Type: image/png"); // Display the output image echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.contrastimage.php Comment More infoAdvertise with us Next Article PHP | Imagick drawImage() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick contrastStretchImage() Function The Imagick::contrastStretchImage() function is an inbuilt function in PHP which is used to enhance the contrast of the image. This function the enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available. Syntax: bool Imagick::contrastStretchIma 2 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 brightnessContrastImage() Function The Imagick::brightnessContrastImage() function is an inbuilt function in PHP which accepts three parameters like Brightness, Contrast and Image channel. It is used to change the brightness, contrast of an image. This function converts the brightness and contrast of image into slope and intercept an 1 min read PHP | Imagick colorMatrixImage() Function The Imagick::colorMatrixImage() function is an inbuilt function in PHP which is used to apply color transformation to the images. This function induces saturation changes, hue rotation, luminance to alpha, and various other effects. This function uses variable-size transformation matrices i.e. 5x5 m 2 min read PHP | Imagick clampImage() Function The Imagick::clampImage() function is an inbuilt function in PHP which is used to restricts the color range from 0 to the quantum depth. This function has no impact on the image which is already in given range. Syntax: bool Imagick::clampImage( int $channel = Imagick::CHANNEL_DEFAULT ) Parameters: T 1 min read PHP | Imagick colorizeImage() Function The Imagick::colorizeImage() function is an inbuilt function in PHP which is used to blends the fill color with each pixel in the image with a specified opacity. Syntax: bool Imagick::colorizeImage( mixed $colorize, mixed $opacity, bool $legacy = FALSE ) Parameters: This function accepts three param 2 min read Like