PHP | Imagick colorizeImage() Function Last Updated : 20 Sep, 2019 Comments Improve Suggest changes 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 clutImage() 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 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 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 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 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 Like