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 // Create a new Gmagick object $gmagick = new Gmagick('geeksforgeeks.png'); // Get the image compose $compose = $gmagick->getimagecompose(); echo $compose; ?> |
Output:
1 // Which is the default composite operator for all Gmagick object.
Program 2:
<?php // Create a new Gmagick object $gmagick = new Gmagick('geeksforgeeks.png'); // Set the image compose $gmagick->setimagecompose(Gmagick::COMPOSITE_COLORIZE); // Get the image compose $compose = $gmagick->getimagecompose(); echo $compose; ?> |
Output:
28
Reference: https://www.php.net/manual/en/gmagick.getimagecompose.php
Recommended Posts:
- PHP | Imagick getImageCompose() Function
- PHP | Gmagick getimagecolors() Function
- PHP | Gmagick writeimage() Function
- PHP | Gmagick shearimage() Function
- PHP | Gmagick addnoiseimage() Function
- PHP | Gmagick resizeimage() Function
- PHP | Gmagick rollimage() Function
- PHP | Gmagick getversion() Function
- PHP | Gmagick flopimage() Function
- PHP | Gmagick rotateimage() Function
- PHP | Gmagick scaleimage() Function
- PHP | Gmagick oilpaintimage() Function
- PHP | Gmagick raiseimage() Function
- PHP | Gmagick reducenoiseimage() Function
- PHP | Gmagick solarizeimage() Function
- PHP | Gmagick thumbnailimage() Function
- PHP | Gmagick spreadimage() Function
- PHP | Gmagick stripimage() Function
- PHP | Gmagick swirlimage() Function
- PHP | Gmagick resampleimage() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

