PHP | Imagick current() Function Last Updated : 25 Jul, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::current() function is an inbuilt function in PHP which is used to return the reference of current Imagick object. This function does not create any copy but returns the same instance of Imagick. Syntax: Imagick Imagick::current( void ) Parameters: This function does not accepts any parameters. Return Value: It returns the instance of Imagick object. Program 1: This program is regarding the simple functioning of the current() method. It will create a variable with a new name pointing to the same instance and show the content of the old one with the help of the new. PHP <?php // Create new Imagick object $im = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-6.png'); // Use Imagick::current() function and // initialized with Image $im1 = $im->current(); // Imagick instance returned in a new variable $im1 header("Content-type: image/png"); // Display image as output echo $im1; ?> Output: Program 2: It performs the blur operation on the image using the 2nd variable and the change will be reflected on the first one as both of them are pointing to the same instance. PHP <?php // Create new Imagick object $im = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-6.png'); // Use Imagick::current() function $im1 = $im->current(); // Use Imagick::blurImage() function to blur the image $im1->blurImage(5, 3); header("Content-type: image/png"); // Display the image as echo $im; ?> Output: Reference: https://www.php.net/manual/en/imagick.current.php Comment More infoAdvertise with us Next Article PHP | Imagick current() Function piyush25pv Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Gmagick current() Function The Gmagick::current() function is an inbuilt function in PHP which is used to return the reference of the current Gmagick object. This function does not create any copy but returns the same instance of Gmagick. Syntax: Gmagick Gmagick::current( void ) Parameters: This function doesnât accept any pa 1 min read PHP | Imagick clear() Function The Imagick::clear() function is an inbuilt function in PHP which is used to clear all resource allocated to an Imagick object. Syntax: bool Imagick::clear( void ) Parameters: This function does not accept any parameter. It just clears off the resources of the Imagick object which is used to call th 2 min read 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 ) Para 1 min read PHP | Imagick __construct() Function The Imagick::__construct() function is an Imagick class constructor which takes the image path or image URL as parameter to instantiate the Imagick object for a specific image or a set of images. Syntax: Imagick::__construct( $files ) Parameters: This function accepts single parameter $files which h 1 min read PHP | Imagick destroy() Function The Imagick::destroy() function is an inbuilt function in PHP which is used to destroy the Imagick object and free all the resources associated with it. You can't access your object content once it is destroyed. Syntax: bool Imagick::destroy( void ) Parameters: This function does not accept any para 1 min read PHP | Imagick filter() Function The Imagick::filter() function is an inbuilt function in PHP which is used to apply custom convolution kernel to the image. A kernel, convolution matrix, or mask is a small matrix. It is used for blur, sharpen, embossing, edge detection, and many more. Syntax: bool Imagick::filter( $ImagickKernel, $ 1 min read PHP | Imagick drawImage() Function The Imagick::drawImage() function is an inbuilt function in PHP which is used to render the ImagickDraw object on the Imagick object. It is used to draw the image on the Imagick instance. We set an image matrix, parameters and the borders of the drawn image with the help of ImagickDraw methods and t 2 min read PHP | ImagickDraw clear() Function The ImagickDraw::clear() function is an inbuilt function in PHP which is used to clear the ImagickDraw object of any accumulated commands, and resets the settings it contains to their defaults. Syntax: bool ImagickDraw::clear( void ) Parameters: This function doesnât accepts any parameter. Return Va 2 min read 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 Like