1. Go to this page and download the library: Download kenura/imagick library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kenura / imagick example snippets
enura\Imagick\ImageProcessor;
$processor = new ImageProcessor();
// Resize an image
$processor->resizeImage('input.jpg', 'output.jpg', 800, 600);
// Compress to ~100KB
$processor->compressToJpg('large.jpg', 'compressed.jpg', 100);
// Add watermark
$processor->addWatermark('photo.jpg', 'watermarked.jpg', 'logo.png', 'bottom-right', 10);
// Convert to WebP
$processor->convertToWebP('photo.jpg', 'photo.webp', 85);