Skip to content
Related Articles

Related Articles

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

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :