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

ActiveMediawiki-extension[Image &amp; Media](/categories/media)

octfx/webp
==========

Generate WebP Versions of images

2.0.0(2y ago)81.3k4[3 issues](https://github.com/octfx/mediawiki-extension-WebP/issues)[1 PRs](https://github.com/octfx/mediawiki-extension-WebP/pulls)GPL-2.0+PHPPHP &gt;=7.3

Since Jan 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/octfx/mediawiki-extension-WebP)[ Packagist](https://packagist.org/packages/octfx/webp)[ Docs](https://github.com/octfx/mediawiki-extension-WebP)[ RSS](/packages/octfx-webp/feed)WikiDiscussions develop Synced yesterday

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

WebP Extension
==============

[](#webp-extension)

Upon file upload this extension creates a WebP (and Avif if active) version of the uploaded image and its thumbs.

Requires a working job queue, [Extension:PictureHtmlSupport](https://github.com/StarCitizenWiki/mediawiki-extensions-PictureHtmlSupport), and a usable version of `imagick`, `libwebp (cwebp)`, or `gd` installed.
As well as `$wgHashedUploadDirectory = true;`, and if Extension:AWS is active `$wgAWSRepoHashLevels` to be `>0`;

Setting `$wgGenerateThumbnailOnParse = false;` is currently not supported.

How does this work?
-------------------

[](#how-does-this-work)

After an upload or file transformation, a transform job is dispatched that creates a webp (and avif if active) file version of the original file.

Additionally, the PictureHtmlSupport extension exposes a hook when a thumbnail is added to the page output.
Extension:WebP utilizes this hook to add a `` element for each active image transformer.

Converting already uploaded images
----------------------------------

[](#converting-already-uploaded-images)

A maintenance script exists to convert already uploaded images:

```
php extensions/WebP/maintenance/CreateFromLocalFiles.php

# To only convert non-thumbnails run
php extensions/WebP/maintenance/CreateFromLocalFiles.php --no-thumbs

# To create thumbnails of custom sizes run
# This will create two thumbnails with size 1000px and 1250px
php extensions/WebP/maintenance/CreateFromLocalFiles.php --thumb-sizes=1000,1250

# To only work on some images run
php extensions/WebP/maintenance/CreateFromLocalFiles.php --titles=ImageA.jpg,ImageB.png

# To force the creation of already existing images run
php extensions/WebP/maintenance/CreateFromLocalFiles.php --overwrite

# Only work on page titles matching a prefix
# Every page starting with prefix 'Example' will be selected
php extensions/WebP/maintenance/CreateFromLocalFiles.php --title-prefix=Example

# Only work on page titles matching a file-type
# Every page starting with file-type 'png' will be selected
# Can be combined with 'title-prefix'
php extensions/WebP/maintenance/CreateFromLocalFiles.php --file-type=png
```

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

[](#installation)

```
wfLoadExtension( 'WebP' );
```

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

[](#configuration)

KeyDescriptionExampleDefault$wgWebPEnableConvertOnUploadEnables file creation after a new image was uploaded. Doesn't work for copy uploads.truetrue$wgWebPEnableConvertOnTransformEnables file creation after a thumbnail was created. This isn't necessary if a thumbhandler is active.falsetrue$wgWebPEnableResponsiveVersionJobsDispatch transform jobs for 1.5x and 2x file versions. Note: This runs for each thumbnail inclusion and may be disabled after all present thumbnails have been converted.falsetrue$wgWebPCheckAcceptHeaderCheck if the accept header contains webp. If not the original file will be served.truefalse$wgWebPCompressionQualityCompression Quality. Lower means worse.5075$wgWebPCompressionQualityAvifCompression Quality for Avif files. Lower means worse.5030$wgWebPFilterStrengthAlpha compression strength. Sets imagick `webp:alpha-quality` and `cwebp -alpha_q`. Lossless is 100.5080$wgWebPAutoFilterEnables the auto filter. This algorithm will spend additional time optimizing the filtering strength to reach a well-balanced quality.falsetrue$wgWebPThumbSizesThumbnail Sizes to create through the maintenance script\[2400\]\[120, 320, 800, 1200, 1600\]$wgEnabledTransformersList of enabled image transformers\[ "MediaWiki\\Extension\\WebP\\Transformer\\AvifTransformer", "MediaWiki\\Extension\\WebP\\Transformer\\WebPTransformer" \]WebP Transformer$wgWebPCWebPLocationPath to `cwebp` executable/usr/bin/cwebp$wgWebPAvifencLocationPath to `avifenc` executable/usr/bin/avifenc### Enabling Avif

[](#enabling-avif)

For full feature support you'll need to install Imagick v7, als v6.9 has multiple bugs.
Alternatively you can install `libavif-bin` (&gt;= 0.9.3) which provides `avifenc`. Do note that this still requires *a* version of imagick installed, as avifenc can't rescale images.

When enabling the Avif transformer, make sure that it is ordered before the webp transformer, as else the browser will pick the webp version.

```
$wgEnabledTransformers = [ "MediaWiki\\Extension\\WebP\\Transformer\\AvifTransformer", "MediaWiki\\Extension\\WebP\\Transformer\\WebPTransformer" ];
```

De-Installation
---------------

[](#de-installation)

Delete the folders `images/webp` and `images/thumbs/webp` and remove the extension.
If the Avif transformer is active remove `images/avif` and `images/thumbs/avif`.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97% 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 ~579 days

Total

2

Last Release

1062d ago

Major Versions

1.0.0 → 2.0.02023-08-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6594492?v=4)[H. C. Kruse](/maintainers/Octfx)[@octfx](https://github.com/octfx)

---

Top Contributors

[![octfx](https://avatars.githubusercontent.com/u/6594492?v=4)](https://github.com/octfx "octfx (130 commits)")[![alistair3149](https://avatars.githubusercontent.com/u/9260542?v=4)](https://github.com/alistair3149 "alistair3149 (1 commits)")[![dolfinus](https://avatars.githubusercontent.com/u/4661021?v=4)](https://github.com/dolfinus "dolfinus (1 commits)")[![GenerationFallout](https://avatars.githubusercontent.com/u/68496923?v=4)](https://github.com/GenerationFallout "GenerationFallout (1 commits)")[![Universal-Omega](https://avatars.githubusercontent.com/u/54654040?v=4)](https://github.com/Universal-Omega "Universal-Omega (1 commits)")

---

Tags

mediawiki-extension

### Embed Badge

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

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

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[october/rain

October Rain Library

1601.7M83](/packages/october-rain)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[mindkomm/timmy

Advanced image manipulation for Timber.

17737.8k](/packages/mindkomm-timmy)[wp-media/imagify-plugin

Image optimization plugin for WordPress by WP Media.

8067.5k](/packages/wp-media-imagify-plugin)[bueltge/multisite-global-media

Multisite Global Media is a WordPress plugin which shares media across the Multisite network.

23132.1k](/packages/bueltge-multisite-global-media)

PHPackages © 2026

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