PHP Imagick haldClutImage () function

PHP

Syntax:
bool Imagick::haldClutImage ($clut, $channel)
Parameters:this function takes two parameters as above and described below:
  • $clut:this parameter is used to store the value of the Imagick object containing the Hald search image .
  • $channel:This parameter provides a channel constant that is valid for channel mode. More than one channel can be combined using the bitwise operator. The default channel in the Imagick function is Imagick::CHANNEL_DEFAULT.
Return value:This function returns True on success.Errors / Exceptions:This function will throw a exceptionImagickException on error.Original Image:
The following program illustrates the Imagick::haldClutImage()function in PHP:Program 1:  
// require_once (` path / vendor / autoload.php `); 
// Create new Imagick objects $imagick = new Imagick ( realpath ( `img / engineerforengineer.png` )); $imagickPalette = new Imagick ( realpath ( " img / engineerforengineer.png " ));  
// Use sepiatoneImage and haldClutImage functions $imagickPalette -> sepiatoneImage (50); $imagick -> haldClutImage ( $imagickPalette );  
// Image title header ( "Content-Type: image / jpg" );  
// Display the output image echo $imagick -> getImageBlob(); ?>
Output: Program 2:  
// require_once (` path / vendor / autoload.php `); 
// Create a new Imagick object $imagick = new Imagick ( `img / engineerforengineer.png` ); $imagickPalette = new Imagick ( "img / engineerforengineer.png" );  
// Using the haldClutImage function $imagickPalette -> sepiatoneImage (150); $imagick -> haldClutImage ( $imagickPalette );  
// Write an output image $imagick -> writeImage ( `raiseImae1.png` );  
// Destroy Imagick $imagick -> destroy(); ?>
Output: Link: http://php.net/manual/en/imagick.haldclutimage.php



Get Solution for free from DataCamp guru