PHP code example of calcinai / php-imagick

1. Go to this page and download the library: Download calcinai/php-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/ */

    

calcinai / php-imagick example snippets


$image = new Imagick('~/sample.png');

$image->cropImage(190, 300, 350, 565);
$image->resizeImage(256, 350, Imagick::FILTER_CATROM, 0);

header("Content-Type: image/png");
echo $image->getImageBlob();

composer