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