HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelTutorial Source codeReport an issue
Category
Example

Imagick::setImageCompressionQuality

← setImageClipMask   setImageDelay →
Sets the image compression quality.

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