PHPackages                             huttchdev/craft-webpme - 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. huttchdev/craft-webpme

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

huttchdev/craft-webpme
======================

Get a WebP image url if the visitors browser and the server both support WebP

1.1.2(2y ago)13.4k↓13.3%[1 issues](https://github.com/HuttchDev/craft-webpme/issues)MITPHPPHP ^8.0

Since Jan 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/HuttchDev/craft-webpme)[ Packagist](https://packagist.org/packages/huttchdev/craft-webpme)[ RSS](/packages/huttchdev-craft-webpme/feed)WikiDiscussions main Synced 2d ago

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

WebP Me for Craft CMS
=====================

[](#webp-me-for-craft-cms)

Simple function that returns a WebP formatted image url if the visitors browser and the server supports WebP, if not then it will fallback to a standard image url.

- If both the server and visitors browser supports WebP, the passed image will be converted to WebP unless the passed image is a SVG.
- If the visitors browser does not support WebP then the image will not be converted and will maintain its current format.
- If the passed image is already a WebP image but the visitors browser does not support WebP then the image will be converted to a PNG (incase of transparency).

Usage
-----

[](#usage)

### WebP Twig Function

[](#webp-twig-function)

```
Example:

```

WebP(image asset, craft image transform params)

### Using Preset Image Transforms

[](#using-preset-image-transforms)

```
Example:
