PHP | Imagick setImageCompose() Function Last Updated : 20 Nov, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The Imagick::setImageCompose() function is an inbuilt function in PHP which is used to set the composite operator associated with the image. This function is used to specify how to composite the image thumbnail when using the Imagick::montageImage() method. Syntax: bool Imagick::setImageCompose( int $compose ) Parameters: This function accepts a single parameter $compose which holds the image composite operator. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the Imagick::setImageCompose() function in PHP: Program 1: php <?php // Create new Imagick Object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Set the Compose $imagick->setImageCompose(70); // Get the Compose $compose = $imagick->getImageCompose(); echo $compose; ?> Output: 70 Program 2: php <?php // Create new Imagick Object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Add label for first image $imagick->labelImage('Image 1'); // Set the Compose for first image $imagick->setImageCompose(10); $imagick->addImage(new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png')); // Add label for second image $imagick->labelImage('Image 2'); // Set the Compose for second image $imagick->setImageCompose(30); // Create a Montage of Images $draw = new ImagickDraw(); $draw->setStrokeColor('black'); $draw->setFillColor('white'); $draw->setStrokeWidth(1); $draw->setFontSize(24); $montage = $imagick->montageImage($draw, "3x2+0+0", "200x160+3+3>", Imagick::MONTAGEMODE_CONCATENATE, "10x10+2+2"); // Display the output $montage->setImageFormat('png'); header("Content-Type: image/png"); echo $montage->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.setimagecompose.php Comment More infoAdvertise with us Next Article PHP | Imagick setImageProfile() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick setImageDispose() Function The Imagick::setImageDispose() function is an inbuilt function in PHP which is used to sets the image disposal method. Syntax: bool Imagick::setImageDispose( $dispose ) Parameters: This function accepts single parameter $dispose which specifies the dispose Imagick object to be set. Return Value: Thi 2 min read PHP | Imagick setImageDispose() Function The Imagick::setImageDispose() function is an inbuilt function in PHP which is used to sets the image disposal method. Syntax: bool Imagick::setImageDispose( $dispose ) Parameters: This function accepts single parameter $dispose which specifies the dispose Imagick object to be set. Return Value: Thi 2 min read PHP | Imagick setImageType() Function The Imagick::setImageType() function is an inbuilt function in PHP which is used to set the image type.Syntax:Â Â bool Imagick::setImageType( int $image_type ) Parameters: This function accepts a single parameter $image_type which contains an integer value corresponding to one of IMGTYPE constants. W 1 min read PHP | Imagick setImagePage() Function The Imagick::setImagePage() function is an inbuilt function in PHP which is used to set the image page geometry. Syntax: bool Imagick::setImagePage(int $width, int $height, int $x, int $y ) Parameters: This function accepts four parameters as mentioned above and described below: $width: It specifies 1 min read PHP | Imagick setImageProfile() Function The Imagick::setImageProfile() function is an inbuilt function in PHP which is used to set the named profile to the Imagick object. Syntax: bool Imagick::setImageProfile( string $name, string $profile ) Parameters:This function accepts two parameters as mentioned above and described below: $name: It 1 min read PHP | Imagick setImageScene() Function The Imagick::setImageScene() function is an inbuilt function in PHP which is used to set the image scene. The value of scene contains an integer value. Syntax: bool Imagick::setImageScene( int $scene ) Parameters: This function accepts a single parameter $scene which holds the scene. Return Value: T 1 min read Like