PHP | Imagick removeImage() Function Last Updated : 17 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::removeImage() function is an inbuilt function in PHP which is used to remove an image from the image list. This function removes the current image which is pointed by the cursor. Syntax: bool Imagick::removeImage( void ) Parameters: This function doesn’t accepts any parameters. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the Imagick::removeImage() function in PHP: Program 1: php <?php // Create a new Imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Count the image echo 'Number of images before removing: '. $imagick->count() . '<br>'; // Remove the Image $imagick->removeImage(); // Count the image echo 'Number of images after removing: '. $imagick->count();; ?> Output: Number of images before removing: 1 Number of images after removing: 0 Program 2: php <?php // Create a new Imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Add a new image to Imagick object $imagick->addImage(new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/20190918234528/colorize1.png')); // Count the image echo 'Number of images before removing: '. $imagick->count() . '<br>'; // Remove the Image $imagick->removeImage(); // Count the image echo 'Number of images after removing: '. $imagick->count();; ?> Output: Number of images before removing: 2 Number of images after removing: 1 Reference: https://www.php.net/manual/en/imagick.removeimage.php Comment More infoAdvertise with us Next Article PHP | Imagick removeImage() Function gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads 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 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 resizeImage() Function The Imagick::resizeImage() function is an inbuilt function in PHP which is used to scale an image to the desired dimensions. Syntax: bool Imagick::resizeImage( int $columns, int $rows, int $filter, float $blur, bool $best_fit = false, bool $legacy = false ) Parameters: This function accepts six para 2 min read PHP | Imagick removeImageProfile() Function The Imagick::removeImageProfile() function is an inbuilt function in PHP which is used to remove the named image profile. Syntax: string Imagick::removeImageProfile( string $name ) Parameters: This function accepts a single parameter $name which holds the name of the profile. Return Value: This func 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