PHP | Imagick pingImage() Function Last Updated : 20 Aug, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The Imagick::pingImage() function is an inbuilt function in PHP which is used to get the basic attributes of the image. This method is used to query image width, height, size, and format without reading the whole image into memory. Syntax: bool Imagick::pingImage( $filename ) Parameters: This function accepts single parameter $filename which holds the file name of the image. Return Value: This function returns True on success. Below program illustrates the Imagick::pingImage() function in PHP: Program: This program tells the height and width of the image with the help of image link. php <?php // Create new Imagick object $image = new Imagick(); // Use Imagick::pingImage() function to the image $image->pingImage( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-6.png'); // Use getImageWidth() function to for image width attribute $width = $image->getImageWidth(); // Use getImageHeight() function to for image width attribute $height = $image->getImageHeight(); // Display the output echo "Width of image: " . $width . "px<br>"; echo "Height of image: " . $height . "px"; ?> Output: Width of image: 600px Height of image: 135px Reference: https://www.php.net/manual/en/imagick.pingimage.php Comment More infoAdvertise with us Next Article PHP | Imagick writeImage() Function P piyush25pv Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick writeImage() Function The Imagick::writeImage() function is an inbuilt function in PHP which is used to write an image to the specified filename. This function saves the image file in the same folder where your PHP script is located. Syntax: bool Imagick::writeImage( string $filename = NULL ) Parameters: This function ac 1 min read PHP | Imagick stripImage() Function The Imagick::stripImage() function is an inbuilt function in PHP which is used to strip all profiles and comments from an image. Syntax: bool Imagick::stripImage( void ) Parameters:This function doesnât accepts any parameter. Return Value: This function returns TRUE on success. Exceptions: This func 1 min read PHP | Imagick remapImage() Function The Imagick::remapImage() function is an inbuilt function in PHP which is used to replace colors in an image with those defined by replacement. The colors are replaced with the closest possible color. Syntax: bool Imagick::remapImage( Imagick $replacement, int $dither ) Parameters:This function acce 2 min read PHP | Imagick previousImage() Function The Imagick::previousImage() function is an inbuilt function in PHP which is used to move to the previous image within the Imagick instance. An Imagick instance may consist of a list of images within it and Imagick previousImage() moves the pointer/cursor to the previous image in the image list with 2 min read PHP | Imagick previewImages() Function The Imagick::previewImages() function is an inbuilt function in PHP which is used to quickly pin-point appropriate parameters for image processing. It tiles 9 thumbnails of the specified image with an image processing operation applied at varying strengths. Syntax: bool Imagick::previewImages( int 1 min read PHP | Imagick readImage() Function The Imagick::readImage() function is an inbuilt function in PHP which is used to read an image from filename. Syntax: bool Imagick::readImage( string $filename ) Parameters:This function accepts a single parameter $filename which holds the name of the file. It can also accept URL of the file. Return 1 min read Like