PHP | Imagick readImages() Function Last Updated : 04 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::readImages() function is an inbuilt function in PHP which is used to read images from an array of filenames and associate them to a single Imagick object. Syntax: bool Imagick::readImages( array $filenames ) Parameters:This function accepts a single parameter $filenames which holds an array containing all the filenames. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the Imagick::readImages() function in PHP: Program 1: php <?php // Create a new imagick object $imagick = new Imagick(); // Array of images $images = [ 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png', 'https://media.geeksforgeeks.org/wp-content/uploads/20190918234528/colorize1.png' ]; // Read the images $imagick->readImages($images); // Display the image header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagick = new Imagick(); // Array of images $images = [ 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png', 'https://media.geeksforgeeks.org/wp-content/uploads/20190918234528/colorize1.png' ]; // Read the images $imagick->readImages($images); // Moving index to 0 to check if the first image // is also inserted. $imagick->setIteratorIndex(0); // Display the image header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Program 3: php <?php // Create a new imagick object $imagick = new Imagick(); // Array of images (from local folder). For this // to work mentioned images should be there in the // local folder. $images = [ 'filename1.png', 'filename2.png' ]; // Read the images $imagick->readImages($images); // Display the image header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: It will show filename2.png on the screen. Reference: https://www.php.net/manual/en/imagick.readimages.php Comment More infoAdvertise with us Next Article PHP | Imagick readImages() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads 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 PHP | Imagick readImageFile() Function The Imagick::readImageFile() function is an inbuilt function in PHP which is used to read image from open filehandle. Syntax: bool Imagick::readImageFile( resource $filename, string $fileName = NULL ) Parameters:This function accepts two parameters as mentioned above and described below: $filehandle 1 min read PHP | Imagick readImageBlob() Function The Imagick::readImageBlob() function is an inbuilt function in PHP which is used to read an image from a binary string. Syntax: bool Imagick::readImageBlob( $image, $filename ) Parameters: This function accepts two parameters as mentioned above and described below: $image: This parameter is used to 1 min read 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 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 Like