PHP | Imagick setImageCompressionQuality() Function Last Updated : 19 Nov, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::setImageCompressionQuality() function is an inbuilt function in PHP which is used to set the image compression quality. Syntax: bool Imagick::setCompressionQuality( int $quality ) Parameters: This function accepts single parameter $quality which holds an integer value representing image compression quality. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the Imagick::setImageCompressionQuality() 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 Compression quality $imagick->setImageCompressionQuality(26); // Get the Compression quality $compressionQuality = $imagick->getImageCompressionQuality(); echo $compressionQuality; ?> Output: 26 Program 2: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Set the Compression quality $imagick->setImageCompressionQuality(1); // Show the output $imagick->setformat('jpg'); header("Content-Type: image/jpg"); echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.setimagecompressionquality.php Comment More infoAdvertise with us Next Article PHP | Imagick setImageOpacity() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick setImageCompression() Function The Imagick::setImageCompression() function is an inbuilt function in PHP which is used to set the image compression type. Syntax: bool Imagick::setImageCompression( int $compression ) Parameters: This function accepts a single parameter $compression which holds an integer matching to one of Imagic 1 min read PHP | Imagick setImageOpacity() Function The Imagick::setImageOpacity() function is an inbuilt function in PHP which is used to set the opacity level of an Imagick object. This method is available in ImageMagick 6.3.1 or newer versions. Syntax: bool Imagick::setImageOpacity( $opct ) Parameters: This function accepts single parameter $opct 1 min read PHP | Imagick setImageOpacity() Function The Imagick::setImageOpacity() function is an inbuilt function in PHP which is used to set the opacity level of an Imagick object. This method is available in ImageMagick 6.3.1 or newer versions. Syntax: bool Imagick::setImageOpacity( $opct ) Parameters: This function accepts single parameter $opct 1 min read PHP | Imagick setImageOpacity() Function The Imagick::setImageOpacity() function is an inbuilt function in PHP which is used to set the opacity level of an Imagick object. This method is available in ImageMagick 6.3.1 or newer versions. Syntax: bool Imagick::setImageOpacity( $opct ) Parameters: This function accepts single parameter $opct 1 min read PHP | Imagick setImageCompose() Function The Imagick::setImageCompose() function is an inbuilt function in PHP which is used to set the composite operator associated with the image. This function is used to specify how to composite the image thumbnail when using the Imagick::montageImage() method. Syntax: bool Imagick::setImageCompose( int 1 min read PHP | Imagick setImageProperty() Function The Imagick::setImageProperty() function is an inbuilt function in PHP which is used to set the image property. The main difference between image properties and image artifacts is that the properties are public whereas artifacts are private. Syntax: bool Imagick::setImageProperty( string $name, stri 1 min read Like