PHPackages                             maximal/php-webp-thumbnailer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. maximal/php-webp-thumbnailer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

maximal/php-webp-thumbnailer
============================

PHP (over Imagine) helper for creating and caching WebP thumbnails in real time

v1.0.0(4y ago)35961[2 issues](https://github.com/maximal/php-webp-thumbnailer/issues)1MITPHP

Since Dec 16Pushed 3y ago2 watchersCompare

[ Source](https://github.com/maximal/php-webp-thumbnailer)[ Packagist](https://packagist.org/packages/maximal/php-webp-thumbnailer)[ RSS](/packages/maximal-php-webp-thumbnailer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

PHP thumbnailer with WebP support
=================================

[](#php-thumbnailer-with-webp-support)

`WebpThumbnailer` is a thumbnail helper which allows you to generate and cache image thumbnails in your PHP application on the fly.

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

[](#installation)

Install this library with Composer:

```
php composer.phar require "maximal/php-webp-thumbnailer" "*"
```

or add

```
"maximal/php-webp-thumbnailer": "*"

```

to the `require` section of your app’s `composer.json` file.

Checking the environment
------------------------

[](#checking-the-environment)

You will need WebP coder (`cwebp` command) installed in your system.

For instance in Ubuntu/Debian it is included in `webp` package:

```
sudo apt install webp
```

Check the command:

```
cwebp -version
```

You should get an output with version number (like `0.6.1`).

If you have installed `cwebp` to a different command or path, configure the static property `WebpThumbnailer::$cwebpCommand` before using the helper (see the example below).

More info about WebP:

Generating thumbnails
---------------------

[](#generating-thumbnails)

Use this thumbnailer in your PHP application:

```
use maximal\thumbnail\WebpThumbnailer;

echo WebpThumbnailer::picture('/path/to/img/image.png', $width, $height);
```

More options (`outbound` instead of default `inset`; `alt` and `class`attribute added):

```
use maximal\thumbnail\WebpThumbnailer;

echo WebpThumbnailer::picture(
	'/path/to/img/image.png',
	$width,
	$height,
	false,
	['alt' => 'Alt attribute', 'class' => 'img-responsive']
);
```

Custom `cwebp` command:

```
use maximal\thumbnail\WebpThumbnailer;

WebpThumbnailer::$cwebpCommand = '/usr/local/bin/cwebp';
echo WebpThumbnailer::picture('/path/to/img/image.jpg', $width, $height);
```

The helper’s `picture()` method uses modern `` HTML tag as follows:

```

```

Here you have `image/webp` source for [browsers which support WebP images](https://caniuse.com/#search=WebP)and traditional (PNG, JPEG, TIFF, GIF) image fallback.

Author
======

[](#author)

- Websites:  and
- StackOverflow story:
- Twitter:
- Telegram:

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1606d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/980679?v=4)[MaximAL](/maintainers/maximal)[@maximal](https://github.com/maximal)

---

Top Contributors

[![maximal](https://avatars.githubusercontent.com/u/980679?v=4)](https://github.com/maximal "maximal (2 commits)")

---

Tags

thumbnailhelperimageimagineWebp

### Embed Badge

![Health badge](/badges/maximal-php-webp-thumbnailer/health.svg)

```
[![Health](https://phpackages.com/badges/maximal-php-webp-thumbnailer/health.svg)](https://phpackages.com/packages/maximal-php-webp-thumbnailer)
```

###  Alternatives

[yiisoft/yii2-imagine

The Imagine integration for the Yii framework

2865.4M275](/packages/yiisoft-yii2-imagine)[folklore/image

Image manipulation library for Laravel 5 based on Imagine and inspired by Croppa for easy url based manipulation

270248.2k5](/packages/folklore-image)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
