PHP | Gmagick getimagecompose() Function
Last Updated :
21 Jan, 2020
The Gmagick::getimagecompose() function is an inbuilt function in PHP which is used to get the composite operator associated with the image. The composite operator decides the method to be used for image composition. The composite operator can be anyone from given COMPOSITE OPERATOR constants.
Syntax:
int Gmagick::getimagecompose( void )
Parameters:This function doesn’t accept any parameter.
Return Value: This function returns an integer value containing the compose operator.
Exceptions: This function throws GmagickException on error.
Below given programs illustrate the Gmagick::getimagecompose() function in PHP:
Program 1:
<?php
$gmagick = new Gmagick( 'geeksforgeeks.png' );
$compose = $gmagick ->getimagecompose();
echo $compose ;
?>
|
Output:
1 // Which is the default composite operator for all Gmagick object.
Program 2:
<?php
$gmagick = new Gmagick( 'geeksforgeeks.png' );
$gmagick ->setimagecompose(Gmagick::COMPOSITE_COLORIZE);
$compose = $gmagick ->getimagecompose();
echo $compose ;
?>
|
Output:
28
Reference: https://www.php.net/manual/en/gmagick.getimagecompose.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...