array Imagick::getImageRedPrimary (void)Parameters:this function takes no parameters.Return value:this function returns an array containing the x and y coordinates of the point.Exceptions: this function will throw ImagickException on error.
The following programs illustrate the Imagick::getImageRedPrimary()function in PHP:Program 1:
/ / Create a new Imagick object
$imagick
=
new
Imagick (
’ https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png ’
);
// Use the getImageRedPrimary function
$res
=
$imagick
-> getImageRedPrimary();
print_r (
$res
);
?>
Output:Array ([x] = > 0.64 [y] = > 0.33)
Program 2:
// Create a new one Imagick object
$imagick
=
new
Imagick (
’ https://media.engineerforengineer.org/wp-content/uploads/20190918234528/colorize1.png ’
);
// Use the setImageRedPrimary function
$imagick
-> setImageRedPrimary (0.5, 0.8);
// Use the getImageRedPrimary function
$res
=
$imagick
-> getImageRedPrimary();
print_r (
$res
);
?>
Output:Array ([x] = > 0.5 [y] = > 0.8)
Link:https://www.php.net/manual/en/imagick.getimageredprimary.php