PHP | Imagick __construct() Function Last Updated : 17 Jul, 2019 Comments Improve Suggest changes Like Article Like Report 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 holds the path to an image to load or an array of paths. It can include wildcards for file names, or can be URLs. Return Value: This function return a new Imagick object on successful execution. Exception: This function throws ImagickException exception on error. Program: This program loads the image using the URL of the image and display on the screen. php <?php // Create a new Imagick object $image = new Imagick( "https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png"); // Browser should know that image is to be loaded on the page header("Content-Type: image/png"); // Display the image object echo $image; ?> Output: Reference: https://www.php.net/manual/en/imagick.construct.php Comment More infoAdvertise with us Next Article PHP | Imagick __construct() Function P piyush25pv Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads 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 | ImagickPixel __construct() Function The ImagickPixel::__construct() function is an inbuilt function in PHP which is used to construct an ImagickPixel object. If a color is specified, the object is constructed and then initialized with that color. Syntax: bool ImagickPixel::__construct( void ) Parameters: This function accepts a single 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 current() Function 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 para 2 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 Like