PHP | Imagick setImageFilename() Function Last Updated : 19 Nov, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::setImageFilename() function is an inbuilt function in PHP which is used to set the filename of a particular image. Syntax: bool Imagick::setImageFilename( string $filename ) Parameters: This function accepts single parameter $filename which holds a string that represent the filename. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the Imagick::setImageFilename() 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'); // Set the Filename $imagick->setImageFilename('myNewFilename.png'); // Get the Filename $name = $imagick->getImageFilename(); echo $name; ?> Output: myNewFilename.png Program 2: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Set the Filename $imagick->setImageFilename('myAnotherNewFilename.png'); // Get the Filename $name = $imagick->getImageFileName(); // Write the image to same folder $imagick->writeImage($name); ?> Output: This program creates a file called myAnotherNewFilename.png in the same folder. Reference: https://www.php.net/manual/en/imagick.setimagefilename.php Comment More infoAdvertise with us Next Article PHP | Imagick setImageFilename() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick setImageProfile() Function The Imagick::setImageProfile() function is an inbuilt function in PHP which is used to set the named profile to the Imagick object. Syntax: bool Imagick::setImageProfile( string $name, string $profile ) Parameters:This function accepts two parameters as mentioned above and described below: $name: It 1 min read PHP | Imagick setImageScene() Function The Imagick::setImageScene() function is an inbuilt function in PHP which is used to set the image scene. The value of scene contains an integer value. Syntax: bool Imagick::setImageScene( int $scene ) Parameters: This function accepts a single parameter $scene which holds the scene. Return Value: T 1 min read PHP | Imagick setImageIndex() Function The Imagick::setImageIndex() function is an inbuilt function in PHP which is used to set the iterator position. Syntax: bool Imagick::setImageIndex( int $index ) Parameters: This function accepts a single parameter $index which holds the index. Return Value: This function returns TRUE on success. Ex 1 min read PHP | Imagick setImagePage() Function The Imagick::setImagePage() function is an inbuilt function in PHP which is used to set the image page geometry. Syntax: bool Imagick::setImagePage(int $width, int $height, int $x, int $y ) Parameters: This function accepts four parameters as mentioned above and described below: $width: It specifies 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 Like