# Kirby 3.6.0 and WebP

**URL:** <https://forum.getkirby.com/t/kirby-3-6-0-and-webp/23987>\
**Category:** Questions\
**Tags:** v3\
**Created:** [November 19, 2021, 12:58pm UTC](https://forum.getkirby.com/t/kirby-3-6-0-and-webp/23987 "2021-11-19T12:58:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![portobien](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/portobien/32/7162_2.png) [@portobien](https://forum.getkirby.com/u/portobien)\
**Post date:** [November 19, 2021, 12:58pm UTC](https://forum.getkirby.com/t/kirby-3-6-0-and-webp/23987/1 "2021-11-19T12:58:55Z")

</div>

Hi there,

I am testing the new WebP feature in Kirby 3.6.0. I really love it. I was wondering: How can I force Kirby to also convert images to .webp from images in my content? For example: images uploaded in a content field.

> **[Templates](https://getkirby.com/docs/guide/templates/basics)**
>
> Templates contain the HTML for your pages, spiced up with some PHP to dynamically pull in your content.

Thanks!

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 19, 2021, 4:36pm UTC](https://forum.getkirby.com/t/kirby-3-6-0-and-webp/23987/2 "2021-11-19T16:36:33Z")

</div>

Not quite sure i follow, you can use the `thumb()` method in your template with the format option for this.

So for example if you have images present from being uploaded before 3.6 upgrade, you can convert like this perhaps:

```auto
<?php $image = $page->images()->first(); ?>
<?= $image->thumb(['format' => 'webp']) ?>
<?= $image->thumb(['format' => 'avif']) ?>

```

You just need a file obect and then you can make it happen 🙂

This should work from a files field:

```auto
<?php if($image = $page->yourfieldname()->toFile()): ?>
  <img src="<?= $image->thumb(['format' => 'webp'])->url() ?>" alt="">
<?php endif ?>
```

---

<div class="post-metadata">

**Author:** ![portobien](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/portobien/32/7162_2.png) [@portobien](https://forum.getkirby.com/u/portobien)\
**Post date:** [November 19, 2021, 5:55pm UTC](https://forum.getkirby.com/t/kirby-3-6-0-and-webp/23987/3 "2021-11-19T17:55:33Z")

</div>

Thanks for your help and reply.  
I mean the images that fall within a kirbytext field. They are still .jpg

```auto
<?= kirbytext($page->text()) ?>

```

Maybe I have to set this in the config?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 19, 2021, 6:01pm UTC](https://forum.getkirby.com/t/kirby-3-6-0-and-webp/23987/4 "2021-11-19T18:01:33Z")

</div>

A standard image KirbyTag renders a full image, not a thumb. So you would have to change the KirbyTag or auto-replace jpeg images with webp via `.htacess` or some other way.

It basically depends on your image strategy, i.e. if you only want to provide WebP images or depending on whether a browser supports that format etc.

---

<div class="post-metadata">

**Author:** ![portobien](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/portobien/32/7162_2.png) [@portobien](https://forum.getkirby.com/u/portobien)\
**Post date:** [November 20, 2021, 10:17am UTC](https://forum.getkirby.com/t/kirby-3-6-0-and-webp/23987/5 "2021-11-20T10:17:11Z")

</div>

Okay I understand! Thank you 🙂
