PHP | Imagick modulateImage() Function
The Imagick::modulateImage() function is an inbuilt function in PHP which is used to control the brightness, saturation, and hue of an image.
Syntax:
bool Imagick::modulateImage( $brightness, $saturation, $hue )
Parameters: This function accepts three parameters as mentioned above and described below:
- $brightness: This parameter is used to hold the value of brightness.
- $saturation: This parameter is used to hold the value of saturation.
- $hue: This parameter is used to hold the value of hue.
Return Value: This function returns True on success.
Below programs illustrate the Imagick::modulateImage() function in PHP:
Original Image:

Program 1:
<?php /*require_once('vendor/autoload.php'); */ header('Content-type: image/png'); /*Create Imagick Object*/ $image = new Imagick('img/geeksforgeeks.png'); /*modulateImage function*/ $image->modulateImage(60, 100, 100); echo $image; ?> |
Output:

Program 2:
<?php /*require_once('vendor/autoload.php');*//*Imagick Object*/ $imagick = new Imagick('img/geeksforgeeks.png'); /*modulateImage*/ $imagick->modulateImage(100, 0, 100); /*Write Image*/$imagick->writeImage('rotationalImage1.png'); /*Destroy Imagick Variable*/$imagick->destroy(); ?> |
Output:

Reference: http://php.net/manual/en/imagick.modulateimage.php
Recommended Posts:
- PHP | Gmagick modulateimage() Function
- PHP | Imagick coalesceImages() Function
- PHP | Imagick getImageWidth() Function
- PHP | Imagick getImageHeight() Function
- PHP | Imagick flopImage() Function
- PHP | Imagick flipImage() Function
- PHP | Imagick brightnessContrastImage() Function
- PHP | Imagick getImageGamma() Function
- PHP | Imagick functionImage() Function
- PHP | Imagick chopImage() Function
- PHP | Imagick charcoalImage() Function
- PHP | Imagick unsharpMaskImage() Function
- PHP | Imagick waveImage() Function
- PHP | Imagick uniqueImageColors() Function
- PHP | Imagick transformImageColorspace() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : nidhi_biet



