Open In App

PHP | Imagick compositeImage() Function

Last Updated : 08 Aug, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report

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 five parameters as mentioned above and described below:

  • $composite_object: It is an Imagick object which holds the composite image or may be realpath of image to compose.
  • $composite: It is a Composite Operator Constants such as Imagick::COMPOSITE_DEFAULT, Imagick::COMPOSITE_MATHEMATICS, etc…
  • x: It holds the column offset of the composited image. The x value will be the numeric format.
  • y: It is hold the row offset of the composited image. The y value will be the numeric format.
  • $channel: It has Imagick channel constants which provides any channel constant that is valid for your channel mode. To apply more than one channel, combine channel type constants using bitwise operators.

Similar Reads