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 colorizeImage() Function 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 borderImage() Function The Imagick::borderImage() function is an inbuilt function in PHP which is used to draw the border in an image. This function creates the border surrounded to the image in the given color. Syntax: bool Imagick::borderImage( $bordercolor, $width, $height ) Parameters: This function accepts three para 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 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 contrastImage() Function 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 a 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 autoLevelImage() Function The Imagick::autoLevelImage() function is an inbuilt function in PHP which is used to adjusts the levels of a particular image channel. The level of the image channel is set the minimum and maximum value of color in the full quantum range. Syntax: bool Imagick::autoLevelImage( $channel ) Parameters: 1 min read Like