PHP | Imagick clone() Function
The Imagick::clone() function is an inbuilt function in PHP which is used to create a copy of Imagick object. This function creates copy of the same instance, that means it will have same properties and any change in it will not reflect to the main object.
Syntax:
Imagick Imagick::clone( void )
Parameters: This function does not accepts any parameters.
Return Value: It returns a copy of Imagick object.
Below program illustrates the Imagick::clone() function in PHP:
Program:
<?php // Create new Imagick object $image = new Imagick( // Use clone() function to copy the image $im_clone = clone $image; header("Content-Type: image/gif"); // Display the image echo $im_clone->getImagesBlob(); ?> |
Output:

Reference: https://www.php.net/manual/en/imagick.clone.php
Recommended Posts:
- PHP | Imagick getImageColors() Function
- PHP | Imagick magnifyImage() Function
- PHP | Imagick shadeImage() Function
- PHP | Imagick smushImages() function
- PHP | Imagick getImageGamma() Function
- PHP | Imagick flipImage() Function
- PHP | Imagick brightnessContrastImage() Function
- PHP | Imagick vignetteImage() Function
- PHP | Imagick functionImage() Function
- PHP | Imagick getImageColorspace() Function
- PHP | Imagick rotateImage() Function
- PHP | Imagick morphology() Function
- PHP | Imagick setRegistry() Function
- PHP | Imagick listRegistry() Function
- PHP | Imagick transverseImage() 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.


