PHP Gmagick getimageblueprimary () Function

PHP

Syntax:
public Gmagick::getimageblueprimary (void): array
Parameters: this function takes no parameters.Returned value:this function returns an array containing the x and y coordinates of the point.The following programs illustrate the Gmagick function::getimageblueprimary() in PHP:Program 1:
Original image:
 
// Create a new Gmagick object $gmagick = new Gmagick ( ' https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-15.png ' );  
// Using getimageblueprimaryfunction $res = $gmagick -> getimageblueprimary(); print_r ( $res ); ?>
Output:
Array ([x] = > 0.15000000596046 [y] = > 0.059999998658895)
Program 2:
Original Image:
$string = " Computer Science portal for Geeks! " ;  
// Create a new image of the above line // and add color $im = new Gmagick(); $draw = new GmagickDraw();  
// Fill the color in the image $draw -> setFillColor ( new GmagickPixel ( 'green' ));  
// Set the text font size $draw -> setFontSize (50); $metrix = $im -> queryFontMetrics ( $draw , $string ); $draw -> annotation (0, 40, $string ); $im -> newImage ( $metrix [ 'textWidth' ], $metrix [ 'textHeight' ], new GmagickPixel ( 'white' ));  
// Draw image $im -> drawImage ( $draw ); $im -> setImageFormat ( ' jpeg' ); $im -> setImageBluePrimary (2.6, 2.9);  
// Using getImageBluePrimary function $res = $im -> getimageblueprimary();  
// Show result print_r ( $res ); ?>
Output:
Array ([x] = > 2.6 [y] = > 2.9)
Link:http://php.net/manual/en/gmagick.getimageblueprimary.php



Get Solution for free from DataCamp guru