PHPackages                             ebski/image-compressor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. ebski/image-compressor

ActiveLibrary[Image &amp; Media](/categories/media)

ebski/image-compressor
======================

Compresses images to webp

1.0.0(5y ago)0186MITPHPPHP ^8.0

Since Sep 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Ebski/image-compressor)[ Packagist](https://packagist.org/packages/ebski/image-compressor)[ RSS](/packages/ebski-image-compressor/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (7)Used By (0)

Image Compressor
----------------

[](#image-compressor)

This library is handy if you need to compress an image to the format of webp. It uses cwebp to compress images into the webp format so make sure to have cwebp available on your server

Other compression formats can be added later if there is a need / want for it.

Installation
------------

[](#installation)

Using composer:

```
composer require ebski/image-compressor

```

to install cwebp on a linux machine

```
sudo apt-get update
sudo apt-get install webp

```

Usage
-----

[](#usage)

Instantiate the WebpCompressor class and call the function compressImage:

```
