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 setImageCompressionQuality() Function 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 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 PHP | Imagick setImageResolution() Function The Imagick::setImageResolution() function is an inbuilt function in PHP which is used to set the resolution of an image object.Syntax:  bool Imagick::setImageResolution($x_resolution, $y_resolution) Parameters: This function accept two parameters as mentioned above and described below:  $x_resolu 2 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 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 setImageArtifact() Function The Imagick::setImageArtifact() function is an inbuilt function in PHP which is used to set the image artifact. The main difference between image properties and image artifacts is that the properties are public whereas artifacts are private. Syntax: bool Imagick::setImageArtifact( string $artifact, 1 min read PHP | Imagick setImageUnits() Function The Imagick::setImageUnits() function is an inbuilt function in PHP which is used to set the units of resolution of a particular image.Syntax:  bool Imagick::setImageUnits( $units ) Parameters: This function accepts single parameter $units which is used to specify the units to be set for image. Res 2 min read PHP | Imagick setImageRedPrimary() Function The Imagick::setImageRedPrimary() function is an inbuilt function in PHP which is used to set the image chromaticity red primary point. Syntax: bool Imagick::setImageRedPrimary( float $x, float $y ) Parameters: This function accept two parameters as mentioned above and described below: $x: It specif 1 min read Like