PHP | Gmagick getimagegreenprimary() Function
Last Updated :
21 Jan, 2020
The Gmagick::getimagegreenprimary() function is an inbuilt function in PHP which is used to returns the chromaticity green primary point. This functions returns an array with keys “x” and “y”.
Syntax:
array Gmagick::getimagegreenprimary( void )
Parameters: This function doesn’t accept any parameter.
Return Value: This function returns an array value containing the x and y coordinates of point.
Exceptions: This function throws GmagickException on error.
Below given programs illustrate the Gmagick::getimagegreenprimary() function in PHP:
Program 1:
<?php
$gmagick = new Gmagick( 'geeksforgeeks.png' );
$res = $gmagick ->getimagegreenprimary();
print ( "<pre>" .print_r( $res , true). "</pre>" );
?>
|
Output:
Array
(
[x] => 0.30000001192093
[y] => 0.60000002384186
)
Program 2:
<?php
$gmagick = new Gmagick( 'geeksforgeeks.png' );
$gmagick ->setimagegreenprimary(6, 8);
$res = $gmagick ->getimagegreenprimary();
print ( "<pre>" .print_r( $res , true). "</pre>" );
?>
|
Output:
Array
(
[x] => 6
[y] => 8
)
Reference: https://www.php.net/manual/en/gmagick.getimagegreenprimary.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...