PHP | ImagickDraw composite() Function Last Updated : 07 Mar, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report The ImagickDraw::compose() function is an inbuilt function in PHP which is used to composite an image into the current image, using the specified composition operator, specified position, and at the specified size. Syntax: bool ImagickDraw::compose( int $compose, float $x, float $y, float $width, float $height, Imagick $compositeWand ) Parameters: This function accepts six parameters as mentioned above and described below: $compose: It specifies the composition operator which corresponds one of COMPOSITE constants.$x: It specifies y-coordinate of the top left corner.$y: It specifies x-coordinate of the top left corner.$width: It specifies width of the composition image.$height: It specifies height of the composition image.$compositeWand: It specifies the Imagick object where composition image is taken from. Return Value: This function returns TRUE on success. Below programs illustrate the ImagickDraw::compose() function in PHP: Program 1: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Create a new ImagickDraw object $draw = new ImagickDraw(); // Composite the Image $draw->composite(imagick::COMPOSITE_COLORIZE, 100, 100, 200, 200, $imagick); // Create a new Imagick object $imagick2 = new Imagick(); // Create a image on imagick object $imagick2->newImage(800, 250, 'white'); // Render the draw commands $imagick2->drawImage($draw); // Add border $imagick->borderImage('green', 1, 1); // Show the output $imagick2->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick2->getImageBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Create a new ImagickDraw object $draw = new ImagickDraw(); // Composite the Image $draw->composite(4, 200, 20, 400, 200, $imagick); // Create a new Imagick object $imagick2 = new Imagick(); // Create a image on imagick object $imagick2->newImage(800, 250, 'orange'); // Render the draw commands $imagick2->drawImage($draw); // Show the output $imagick2->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick2->getImageBlob(); ?> Output: Comment More infoAdvertise with us Next Article PHP | ImagickDraw circle() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | ImagickDraw clone() Function The ImagickDraw::clone() function is an inbuilt function in PHP which is used to make an exact copy of the specified ImagickDraw object. Syntax: ImagickDraw ImagickDraw::clone( void ) Parameters: This function doesnât accepts any parameter. Return Value: This function returns the exact copy of the s 2 min read PHP | ImagickDraw color() Function The ImagickDraw::color() function is an inbuilt function in PHP which is used to draw color on the image using the current fill color, starting at the specified position, and using specified paint method. Syntax: bool ImagickDraw::color( float $x, float $y, int $paintMethod ) Parameters: This functi 2 min read PHP | Imagick compositeImage() Function The Imagick::compositeImage() function is an inbuilt function in PHP which is used to composite one image into another image and gives composite image. Syntax: bool Imagick::compositeImage( $composite_object, $composite, $x, $y, $channel = Imagick::CHANNEL_DEFAULT ) Parameters: This function accepts 2 min read PHP | ImagickDraw circle() Function The ImagickDraw::circle() function is an inbuilt function in Imagick library of PHP which is used to draw a circle. Syntax: bool ImagickDraw::circle( $ox, $oy, $px, $py ) Parameters: This function accepts four parameters as mentioned above and described below: $ox: This parameter takes the value of 1 min read PHP | ImagickDraw __construct() Function The ImagickDraw::__construct() function is an inbuilt function in PHP which is used to initialize a ImagickDraw object. Syntax: bool ImagickDraw::__construct( void ) Parameters: This function doesnât accept any parameter. Return Value: This function returns TRUE on success. Exceptions: This function 1 min read PHP | Gmagick compositeimage() Function The Gmagick::compositeimage() function is an inbuilt function in PHP which is used to composite one image onto another at the specified offset. Offset is actually the distance from where to start compositing the second image. Syntax: Gmagick Gmagick::compositeimage( Gmagick $source, int $COMPOSE, in 2 min read Like