PHP | Imagick clutImage() Function Last Updated : 21 Sep, 2021 Comments Improve Suggest changes Like Article Like Report 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 function accepts two parameters as mentioned above and described below: $lookup_table: This parameter containing Imagick object for color lookup table.$channel: It is the channel constants which provides any channel that is valid for your channel mode. The default value of $channel is Imagick::CHANNEL_DEFAULT. Return Value: This function returns True on success or false on failure. Below program illustrates the Imagick::clutImage() function in PHP: Program: PHP <?php // Declare an Imagick object $image = new Imagick( 'https://write.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-17.png'); $clut = new Imagick(); // Imagick object chosen green color from color lookup table $clut->newImage(1, 1, new ImagickPixel('green')); // No channel is applied hence default channel is used $image->clutImage($clut); header("Content-Type: image/jpg"); // Display the output image echo $image->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.clutimage.php Create Quiz Comment V VigneshKannan3 Follow 0 Improve V VigneshKannan3 Follow 0 Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like