Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

PHP | Imagick getCompressionQuality() Function

  • Last Updated : 08 Nov, 2019

The Imagick::getCompressionQuality() function is an inbuilt function in PHP which is used to get the object compression quality.

Syntax:

int Imagick::getCompressionQuality( void )

Parameters: This function does not accept any parameters.

Return Value: This function returns an integer value on success.

Below programs illustrate the Imagick::getCompressionQuality() function in PHP:

Program 1:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Get the Compression quality
$compressionQuality = $imagick->getCompressionQuality();
  
echo $compressionQuality;
?>

Output:

0

Program 2:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Set the Compression quality
$imagick->setCompressionQuality(50);
  
// Get the Compression quality
$compressionQuality = $imagick->getCompressionQuality();
  
echo $compressionQuality;
?>

Output:

50

Reference: https://www.php.net/manual/en/imagick.getcompressionquality.php

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!