$img = new Imagick('example.jpg'); $img->setImageCompressionQuality(50); $img->writeImage('example_compressed.jpg');
$img = new Imagick('example.png'); $img->setImageFormat('png'); $img->setImageCompressionQuality(90); $img->writeImage('example_high_quality.png');
$thumb = new Imagick('example_large.jpg'); $thumb->cropThumbnailImage(100, 100); $thumb->setImageCompressionQuality(10); $thumb->writeImage('example_thumb.jpg');In these examples, the package library used is Imagick, which is an extension for PHP that allows you to create and manipulate images using a wide range of features and methods.