PHPackages                             felixhaeberle/kirby3-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. felixhaeberle/kirby3-webp

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

felixhaeberle/kirby3-webp
=========================

WebP &amp; AVIF for Kirby — automatic companion files on upload, responsive &lt;picture&gt; helpers and CLI bulk conversion. Compatible with Kirby 4 and Kirby 5.

v3.0.0(3w ago)377.8k↓31.3%7[2 issues](https://github.com/felixhaeberle/kirby3-webp/issues)MITPHPPHP &gt;=8.1

Since Jun 22Pushed 3y ago7 watchersCompare

[ Source](https://github.com/felixhaeberle/kirby3-webp)[ Packagist](https://packagist.org/packages/felixhaeberle/kirby3-webp)[ RSS](/packages/felixhaeberle-kirby3-webp/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

kirby-webp
==========

[](#kirby-webp)

[![license](https://camo.githubusercontent.com/08f1327ba45a43077d8c9aa7fa506e8e2424e17570d978310e718b292a489591/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f66656c69786861656265726c652f6b69726279332d77656270)](https://camo.githubusercontent.com/08f1327ba45a43077d8c9aa7fa506e8e2424e17570d978310e718b292a489591/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f66656c69786861656265726c652f6b69726279332d77656270)[![kirby](https://camo.githubusercontent.com/a4db62e5ac7c4324aad6f85cbd8225661ac7831876983ee714fc73df406fba12/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6b697262792d34253230253242253230352d626c61636b)](https://camo.githubusercontent.com/a4db62e5ac7c4324aad6f85cbd8225661ac7831876983ee714fc73df406fba12/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6b697262792d34253230253242253230352d626c61636b)[![php](https://camo.githubusercontent.com/08613a962ce0ea7e8885964f9c8f7bb3468dc40003f03fd7c6fdd63ecc6fc9ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d373737626233)](https://camo.githubusercontent.com/08613a962ce0ea7e8885964f9c8f7bb3468dc40003f03fd7c6fdd63ecc6fc9ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d373737626233)

**WebP &amp; AVIF for Kirby** — serve modern image formats without thinking about it. 🚀

Two ways to use it, combinable:

1. **`` helpers (recommended)** — `$file->picture()`, `$file->webp()`, `$file->avif()` build responsive markup on top of Kirby's native thumb API. Works on every server, no rewrite rules, CDN-safe, lazy generation via Kirby's media system.
2. **Companion mode (classic)** — generates a `.webp`/`.avif` twin next to every uploaded image so your web server can transparently swap formats via content negotiation. This is what v1 of this plugin did — now with a fixed lifecycle (replace, rename, delete), AVIF, collision-safe naming and a CLI for bulk conversion.

Requirements
------------

[](#requirements)

- Kirby **4** or **5**
- PHP **8.1+**
- A thumb driver that can write WebP/AVIF: GD (default, needs `imagewebp`/`imageavif`), Imagick (`thumbs.driver => 'imagick'`, Kirby 5.1+) or ImageMagick binaries. Optional: [`rosell-dk/webp-convert`](https://github.com/rosell-dk/webp-convert) is picked up automatically for WebP if it is installed — useful when your GD build lacks WebP support.

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

[](#installation)

### Composer

[](#composer)

```
composer require felixhaeberle/kirby3-webp

```

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/felixhaeberle/kirby3-webp.git site/plugins/kirby3-webp

```

### Download

[](#download)

[Download](https://github.com/felixhaeberle/kirby3-webp/archive/master.zip) and copy the folder to `site/plugins/kirby3-webp`.

1. Responsive `` (recommended)
---------------------------------------

[](#1-responsive-picture-recommended)

```
// template: one call, done
