Change language

PHP Imagick getImageChannelDistortion () Function

Syntax:
float Imagick::getImageChannelDistortion (Imagick $reference, int  $channel, int $metric)
Parameters:This function takes three parameters as above and described below:
  • link:specifies an Imagick object to compare.
  • channel:specifies a channel constant valid for your channel mode. To apply more than one channel, combine the channel type constants using bitwise operators.
  • metric:specifies one of the metric type constants. The list of metric constants is shown below:
    • imagick::METRIC_UNDEFINED (integer)
    • imagick::METRIC_MEANABSOLUTEERROR (integer)
    • imagick::METRIC_MEANSQUAREERROR (integer)
    • imagick::METRIC_PEAKABSOLUTEERROR (integer)
    • imagick::METRIC_PEAKSIGNALTONOISERATIO (integer)
    • imagick::METRIC_ROOTMEANSQUAREDERROR (integer)
Exceptions:This function will throw an ImagickException on error.Return Value:This function will return TRUE if successful.The following programs illustrate the Imagick::getImageChannelDistortion() functionin PHP:Program 1:  
// Create two new imagick objects $imagick1 = new Imagick ( https://media.engineerforengineer.org/wp-content/uploads/20190823154611/engineerforengineer24.png ); $imagick2 = new Imagick ( https://media.engineerforengineer.org/wp-content/uploads/20191112223241/trans9.png );  
// Get distortion with constant METRIC as imagick::METRIC_MEANABSOLUTEERROR $distortion = $imagick1 -> getImageChannelDistortion ( $imagick2 , 0, 1); echo $distortion ; ?>
Output:
122728
Program 2:  
// Create two new imagick objects $imagick1 = new Imagick ( https://media.engineerforengineer.org/wp-content/uploads/20190823154611/engineerforengineer24.png ); $imagick2 = new Imagick ( https://media.engineerforengineer.org/wp-content/uploads/20190823154611/engineerforengineer24.png );  
// Get distortion with constant METRIC // as imagick::METRIC_MEANABSOLUTEERROR $distortion = $imagick1 -> getImageChannelDistortion ( $imagick2 , 0, 1); echo $distortion ; ?>
Output:
0
Note:The second example displays 0 because both images are the same.Link: https://www.php.net/manual/en/imagick.getimagechanneldistortion.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