PHP code example of alimi7372 / webp-convertor

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

    

alimi7372 / webp-convertor example snippets


use Alimi7372\Webp\WebpService;

app('webp')->convert($imagePath, $outputPath);

use Alimi7372\Webp\Facades\WebpFacade as WEBP;

WEBP::convert($imagePath, $outputPath, 75);

convert_to_webp($imagePath, $outputPath, 75);