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   // Create new Imagick object $imagick = new Imagick(   // Apply the contrastImage() function $imagick->contrastImage(false);   header("Content-Type: image/png");   // Display the output image echo $imagick->getImageBlob(); ?> |
Output:
Program 2:
<?php   // Create new Imagick object $imagick = new Imagick(   // 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


… [Trackback]
[…] There you will find 45441 more Info to that Topic: geeksforgeeks.org/php-imagick-contrastimage-function-2/ […]
… [Trackback]
[…] There you can find 92585 more Information to that Topic: geeksforgeeks.org/php-imagick-contrastimage-function-2/ […]
… [Trackback]
[…] Read More Info here to that Topic: geeksforgeeks.org/php-imagick-contrastimage-function-2/ […]
… [Trackback]
[…] Read More to that Topic: geeksforgeeks.org/php-imagick-contrastimage-function-2/ […]
… [Trackback]
[…] Information to that Topic: geeksforgeeks.org/php-imagick-contrastimage-function-2/ […]