Change language

PHP Imagick compareImageChannels () function

Syntax:
array Imagick::compareImageChannels (Imagick $image, int  $channelType, int $metricType)
Parameters:This function takes three parameters as above and described below:
  • $image:this parameter contains the Imagick object that contains the image to compare.
  • $channelType:this parameter contains the Imagick channel constants, which provide any channel constant that suits your channel mode. Use the bitwise operator to combine one or more channel constants.  Click here for a list of channel constants
  • $metricType:are constants of type Metric.  Click here for a list of metric constants type.
Return value:returns an array of new_wand and distortion.Errors / Exceptions:Returns exceptionImagickException on error.The following program illustrates the Imagick::compareImageChannels() function in PHP:Program:  
 
// Save the path to the image in variables $imagePath1 = " https://cdncontribute.engineerforengineer.org/wp-content/uploads/engineerforengineer-9.png " ; $imagePath2 = " https://www.engineerforengineer.org/wp-content/uploads/gfg_200X200.png " ; $imagePath3 = " https://cdncontribute.engineerforengineer.org/wp-content/uploads/negateImage.png " ;  
// Create a new Imagick object $imagick1 = new Imagick ( $imagePath1 ); $imagick2 = new Imagick ( $imagePath2 ); $imagick3 = new Imagick ( $imagePath3 );  
// Use the CompareImageChannels() function to find
// difference between images $diff12 = $imagick1 -> compareImageChannels ( $imagick2 , Imagick::CHANNEL_ALL, Imagick::METRIC_MEANABSOLUTEERROR ); $diff13 = $imagick1 -> compareImageChannels ( $imagick3 , Imagick::CHANNEL_ALL, Imagick::METRIC_MEANABSOLUTEERROR);  
// Print the difference in the array print_r ( $diff12 ); print_r ( $diff13 );  
?>
Output:
Array ([0] = > Imagick Object() [1] = > 0.084920034052215) Array ([0] = > Imagick Object() [1] = > 0.63074787218949)
Link: https://www.php.net/ manual / en / imagick.compareimagechannels.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method