HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Imagick::setImageCompressionQuality

← setImageClipMask   setImageDelay →
Sets the image compression quality.

Example

function setImageCompressionQuality($image_path, $quality)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->setImageCompressionQuality($quality);
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}