Skip to content

A PHP class to convert JPG, JPEG, PNG or GIF images to webp format

License

Notifications You must be signed in to change notification settings

rakibtg/PHP-ImageToWebp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP-ImageToWebp

A PHP class to convert JPG, PEG, PNG or GIF images to webp format

How to use it

As an example take a look at the index.php file.

  <?php
    require "./ImageToWebp.php"; // Load the class.

    $jw = new ImageToWebp(); // Instantiate the object.
    
    // Call the convert method and pass the source and destination
    // you can also specify webp quality in the third params.
    $jw->convert( './png-test.png', './png-test.webp' );
    $jw->convert( './jpg-test.jpg', './jpg-test.webp', 95 );

Image size comparision

Screenshot showing image size after being converted to webp format

About

A PHP class to convert JPG, JPEG, PNG or GIF images to webp format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages