PHPackages                             s1syphos/kirby-webp - 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. s1syphos/kirby-webp

AbandonedArchivedKirby-plugin[Image &amp; Media](/categories/media)

s1syphos/kirby-webp
===================

WebP generation for Kirby

0.5.0(8y ago)32563MITPHP

Since Feb 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/S1SYPHOS/kirby-webp)[ Packagist](https://packagist.org/packages/s1syphos/kirby-webp)[ RSS](/packages/s1syphos-kirby-webp/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (1)Versions (11)Used By (0)

Kirby WebP
==========

[](#kirby-webp)

[![Release](https://camo.githubusercontent.com/8f6829f6c9f69039fa6fa0beb225c71b2a828ab1c0d9a25afa0c7cf19ec61b7d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f5331535950484f532f6b697262792d776562702e7376673f636f6c6f723d253232627269676874677265656e253232)](https://github.com/S1SYPHOS/kirby-webp/releases) [![License](https://camo.githubusercontent.com/0e32c329fc28e1b70b8f2135d1425c78b7550097253213d0bf3ebafbba1d75d5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5331535950484f532f6b697262792d776562702e737667)](https://github.com/S1SYPHOS/kirby-webp/blob/master/LICENSE) [![Issues](https://camo.githubusercontent.com/fd7e66a549609193dac4e2a383feaf5818246473772608c14472f31a9c3536cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f5331535950484f532f6b697262792d776562702e737667)](https://github.com/S1SYPHOS/kirby-webp/issues)

This plugin generates WebP images alongside your uploaded JPGs &amp; PNGs - so **you** don't have to.

**Table of contents**

- [1. What is it good for?](#whats-is-it-good-for)
- [2. Getting started](#getting-started)
- [3. Configuration](#configuration)
- [4. Options](#options)
- [5. Troubleshooting](#troubleshooting)
- [6. Credits / License](#credits--license)

What is it good for?
--------------------

[](#what-is-it-good-for)

Absolutely .. smaller image size:

> WebP is a method of lossy and lossless compression that can be used on a large variety of photographic, translucent and graphical images found on the web. The degree of lossy compression is adjustable so a user can choose the trade-off between file size and image quality. WebP typically achieves an average of 30% more compression than JPEG and JPEG 2000, without loss of image quality (see [Comparative Study](https://developers.google.com/speed/webp/docs/c_study)).
>
> [Google Developers](https://developers.google.com/speed/webp/faq)

Current [browser support](https://caniuse.com/#feat=webp) for WebP images is decent (Chrome, Opera &amp; most mobile browsers), although heavily depending on your target region (ranging from North America (60%) &amp; Europe (65%) to over 80% in Africa &amp; South America).

For further information, including criticism, check out its [Wikipedia article](https://en.wikipedia.org/wiki/WebP). That being said, another interesting approach gearing towards the replacement of JPEG is Fabrice Bellard's "[Better Portable Graphics](https://bellard.org/bpg)" (BPG) format.

Getting started
---------------

[](#getting-started)

Use one of the following methods to install &amp; use `kirby-webp`:

### Composer

[](#composer)

```
composer require S1SYPHOS/kirby-webp:dev-composer

```

### Git submodule

[](#git-submodule)

If you know your way around Git, you can download this plugin as a [submodule](https://github.com/blog/2104-working-with-submodules):

```
git submodule add https://github.com/S1SYPHOS/kirby-webp.git site/plugins/kirby-webp

```

### Clone or download

[](#clone-or-download)

1. [Clone](https://github.com/S1SYPHOS/kirby-webp.git) or [download](https://github.com/S1SYPHOS/kirby-webp/archive/master.zip) this repository.
2. Unzip / Move the folder to `site/plugins`.

### Activate the plugin

[](#activate-the-plugin)

Activate the plugin with the following line in your `config.php`:

```
c::set('plugin.kirby-webp', true);

```

Configuration
-------------

[](#configuration)

After uploading some images, you are now officially ready to serve their newly generated WebP versions.

### Apache

[](#apache)

If you're using [Apache](http://httpd.apache.org/) as your webserver, add the following lines to your `.htaccess`:

```

  RewriteEngine On

  # Checking for WebP browser support ..
  RewriteCond %{HTTP_ACCEPT} image/webp

  # .. and if there's a WebP version for the requested image
  RewriteCond %{DOCUMENT_ROOT}/$1.webp -f

  # Well, then go for it & serve WebP instead
  RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]

  Header append Vary Accept env=REDIRECT_accept

  AddType image/webp .webp

```

### NGINX

[](#nginx)

If you're using [NGINX](https://nginx.org/en/) as your webserver, add the following lines to your virtual host setup (for more information, go [here](https://github.com/uhop/grunt-tight-sprite/wiki/Recipe:-serve-WebP-with-nginx-conditionally) or [there](https://optimus.keycdn.com/support/configuration-to-deliver-webp)):

```
// First, make sure that NGINX' `mime.types` file includes 'image/webp webp'
include /etc/nginx/mime.types;

// Checking if HTTP's `ACCEPT` header contains 'webp'
map $http_accept $webp_suffix {
  default "";
  "~*webp" ".webp";
}

server {
  // ...

  // Checking if there's a WebP version for the requested image ..
  location ~* ^.+\.(jpe?g|png)$ {
    add_header Vary Accept;
    // .. and if so, serving it
    try_files $1$webp_ext $uri =404;
  }
}

```

Options
-------

[](#options)

Change `kirby-webp` options to suit your needs:

OptionTypeDefaultDescription`plugin.kirby-webp.hooks`Array`['upload']`Contains all `panel.file.*` [hooks](https://getkirby.com/docs/developer-guide/advanced/hooks) WebP generation should be applied to (allowed values are `upload`, `update`, `rename` and `replace`).`plugin.kirby-webp.quality`Integer`90`Defines WebP image quality (ranging from 0 to 100).`plugin.kirby-webp.stripMetadata`Boolean`true`Optionally enables / disables transfer of JPEG metadata onto the WebP image.`plugin.kirby-webp.convertedImage`Boolean`true`Optionally enables / disables output of converted image (`false` results in text output about the conversion process).`plugin.kirby-webp.serveOriginalOnFail`Boolean`true`Defines behavior in case all converters fail - by default, the original image will be served, whereas `false` will generate an image with the error message.`plugin.kirby-webp.converters`Array`['gd', 'cwebp']`Defines the desired order of execution for all supported converters (allowed values are `imagick`, `cwebp`, `gd` and `ewww`). Note that this only changes their order, but doesn't remove any of them.Troubleshooting
---------------

[](#troubleshooting)

Despite stating that `An unexpected error occurred`, WebP generation after renaming / updating images works - `replace` doesn't work at all .. PRs are always welcome 🍾

Because of that, only `upload` is included by default. If you wish to investigate this further and / or don't care too much about the errror, go ahead with `c::set('plugin.webp.actions', ['upload', 'update', 'rename', 'replace']);` in your `config.php`.

Credits / License
-----------------

[](#credits--license)

`kirby-webp` is based on Bjørn Rosell's [PHP library](https://github.com/rosell-dk/webp-convert) `webp-convert` library. It is licensed under the [MIT License](LICENSE), but **using Kirby in production** requires you to [buy a license](https://getkirby.com/buy). Are you ready for the [next step](https://getkirby.com/next)?

Special Thanks
--------------

[](#special-thanks)

I'd like to thank everybody that's making great software - you people are awesome. Also I'm always thankful for feedback and bug reports :)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.3% 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

Every ~3 days

Total

9

Last Release

3022d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5933072731cd628e1ef2bdc59bc81da16dac859145a3be2dc5c83aab9095179b?d=identicon)[S1SYPHOS](/maintainers/S1SYPHOS)

---

Top Contributors

[![S1SYPHOS](https://avatars.githubusercontent.com/u/12161504?v=4)](https://github.com/S1SYPHOS "S1SYPHOS (33 commits)")[![Pascalmh](https://avatars.githubusercontent.com/u/498197?v=4)](https://github.com/Pascalmh "Pascalmh (2 commits)")

---

Tags

htaccessimageskirbykirby-cmskirby-pluginnginx-confperformancespeedwebpwebp-generationwebp-generatorwebp-images

### Embed Badge

![Health badge](/badges/s1syphos-kirby-webp/health.svg)

```
[![Health](https://phpackages.com/badges/s1syphos-kirby-webp/health.svg)](https://phpackages.com/packages/s1syphos-kirby-webp)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[rosell-dk/webp-convert-cloud-service

Cloud service for converting JPEG &amp; PNG to WebP

545.9k4](/packages/rosell-dk-webp-convert-cloud-service)[felixhaeberle/kirby3-webp

Kirby 3 CMS plugin for converting JPG, JPEG and PNG into much smaller WEBP – speed up your website!

377.7k](/packages/felixhaeberle-kirby3-webp)[web200/magento-mod-web200_image-resize

Magento 2 Module to add simple image resizing

1033.7k1](/packages/web200-magento-mod-web200-image-resize)

PHPackages © 2026

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