PHP code example of hyyan / jaguar

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

    

hyyan / jaguar example snippets


use Jaguar\Canvas,
    Jaguar\Transformation,
    Jaguar\Dimension,
    Jaguar\Action\Posterize;
    
$transformation = new Transformation(new Canvas('/path/to/image'));
$transformation->resize(new Dimension(300,300))
               ->apply(new Posterize(40))
               ->watermark(new Canvas('/path/to/watermark'))
               ->getCanvas()
               ->save('/save/somewhere')
               ->show(); // send the result to the browser