The Imagick::getImageCompressionQuality() function is an inbuilt function in PHP that is employed to induce the present image’s compression quality.
Syntax:
int Imagick::getImageCompressionQuality( void )
Parameters: This function does not accept any parameters.
Return Value: This function returns a whole number value containing the current image’s compression quality.
Below programs illustrate the Imagick::getImageCompressionQuality() function in PHP:
Program 1:
<?php // Create a new imagick object $imagick = new Imagick( // Get the Compression quality $compressionQuality = $imagick ->getImageCompressionQuality(); echo $compressionQuality ; ?> |
Output:
0 // which is the default value.
Program 2:
<?php // Create a new imagick object $imagick = new Imagick( // Set the Compression quality $imagick ->setImageCompressionQuality(65); // Get the Compression quality $compressionQuality = $imagick ->getImageCompressionQuality(); echo $compressionQuality ; ?> |
Output:
65
Reference: https://www.php.net/manual/en/imagick.getimagecompressionquality.php