Skip to content
Related Articles

Related Articles

PHP | Gmagick getimagegreenprimary() Function

View Discussion
Improve Article
Save Article
  • Last Updated : 21 Jan, 2020
View Discussion
Improve Article
Save Article

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
  
// Create a new Gmagick object
$gmagick = new Gmagick('geeksforgeeks.png');
  
// Use the getimagegreenprimary() function
$res = $gmagick->getimagegreenprimary();
print("<pre>".print_r($res, true)."</pre>");
?>


Output:

Array
(
    [x] => 0.30000001192093
    [y] => 0.60000002384186
)

Program 2:




<?php
  
// Create a new Gmagick object
$gmagick = new Gmagick('geeksforgeeks.png');
  
// Use the setimagegreenprimary() function
$gmagick->setimagegreenprimary(6, 8);
  
// Use the getimagegreenprimary() function
$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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!