PHP | Imagick colorizeImage() Function Last Updated : 20 Sep, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 parameters as mentioned above and described below: $colorize: This parameter holds ImagickPixel object or a string which contains the colorize color. $opacity: This parameter holds ImagickPixel object or float which contains the opacity. The value 1.0 represents the fully opaque and 0.0 represents fully transparent. $legacy: This parameter holds a boolean which tells whether legacy behaviour is desired. Keeping it to TRUE is recommended to use string colors. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the Imagick::colorizeImage() function in PHP: Program 1: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png'); // Colorize the image $imagick->colorizeImage('blue', 1, true); header("Content-Type: image/jpg"); // Display the output image echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png'); // Colorize the image $imagick->colorizeImage('orange', 0.5, true); header("Content-Type: image/jpg"); // Display the output image echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.colorizeimage.php Comment More infoAdvertise with us Next Article PHP | Imagick colorizeImage() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads 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 clutImage() Function The Imagick::clutImage() function is an inbuilt function in PHP which is used to replace the colors in the image. The second parameter of this function replaces the color in a specific channel. Syntax: bool Imagick::clutImage( $lookup_table, $channel = Imagick::CHANNEL_DEFAULT ) Parameters: This f 1 min read PHP | Imagick equalizeImage() Function The Imagick::equalizeImage() function is an inbuilt function in PHP which is used to equalizes the histogram of an image. Syntax: bool Imagick::equalizeImage( void ) Parameter: This function does not accepts any parameter. Return Value: This function returns True on success. Original Image: Below pr 1 min read PHP | Imagick cropImage() Function The Imagick::cropImage() function is an inbuilt function in PHP which is used to extracts the region of the image.Syntax:  int Imagick::cropImage( $width, $height, $x, $y ) Parameters: This function accept four parameters as mention above and describe below.  $width: This parameter is used to spec 2 min read PHP | Imagick colorFloodfillImage() Function The Imagick::colorFloodfillImage() function is an inbuilt function in PHP which is used to change the color value of any pixel that matches the target. Syntax: bool Imagick::colorFloodfillImage( $color, $fuzz, $bordercolor, $x, $y ) Parameters: This function accepts five parameters as mentioned abov 1 min read Like