PHP | Imagick setFormat() Function Last Updated : 05 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::setFormat() function is an inbuilt function in PHP which is used to set the format of the Imagick object. Syntax: bool Imagick::setFormat( string $format ) Parameters: This function accepts a single parameter $format which holds an string value. Return Value: This function returns TRUE on success. Below programs illustrate the Imagick::setFormat() 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 Format $imagick->setFormat('png'); // Get the Format $format = $imagick->getFormat(); echo $format; ?> Output: 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 Format $imagick->setFormat('jpeg'); // Get the Format $format = $imagick->getFormat(); echo $format; ?> Output: jpeg Reference: https://www.php.net/manual/en/imagick.setformat.php Comment More infoAdvertise with us Next Article PHP | Imagick setFormat() Function gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick setFont() Function The Imagick::setFont() function is an inbuilt function in PHP which is used to set the font. Syntax: bool Imagick::setFont( string $font ) Parameters: This function accepts single parameter $font which holds the name of font file. Return Value: This function returns TRUE on success. Extensions: GD e 1 min read PHP | Imagick setImageFormat() Function The Imagick::setImageFormat() function is an inbuilt function in PHP which is used to set the format of a particular image in a sequence.Syntax:Â Â bool Imagick::setImageFormat( string $format ) Parameters: This function accepts a single parameter $format which holds a string value of the image forma 1 min read PHP | Imagick queryFormats() Function The Imagick::queryFormats() function is an inbuilt function in PHP which is used to get the formats supported by Imagick. Syntax: array Imagick::queryFormats( string $pattern = "*" ) Parameters: This function accepts a single parameter $pattern which holds the pattern to be matched with formats. Ret 5 min read PHP | Gmagick setimageformat() Function The Gmagick::setimageformat() function is an inbuilt function in PHP which is used to set the image format. Syntax: Gmagick Gmagick::setimageformat( string $imageFormat ) Parameters: This function accepts a single parameter $imageFormat which holds the image format. Return Value: This function retur 1 min read PHP | Imagick setOption() Function The Imagick::setOption() function is an inbuilt function in PHP which is used to set an option. Syntax: bool Imagick::setOption( string $key, string $value ) Parameters: This function accepts two parameters as mentioned above and described below: $key: It specifies the key for the option. $value: It 1 min read Like