PHP code example of amirrezam75 / image-optimizer

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

    

amirrezam75 / image-optimizer example snippets


(new Image('animated.gif'))->optimize();

(new Image('animated.gif'))->optimize('output-path', Optimizer $optimizer);

$outputPath = (new Image('animated.gif'))
    ->optimize()
    ->convertToWebm();

(new Image('animated.gif'))->convert(Converter $converter);