# Avif images not getting picked by up Google Pagespeed

**URL:** <https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244>\
**Category:** Questions\
**Created:** [March 31, 2023, 3:16am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244 "2023-03-31T03:16:21Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![darcemac](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@darcemac](https://forum.getkirby.com/u/darcemac)\
**Post date:** [April 5, 2023, 2:43am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/21 "2023-04-05T02:43:37Z")

</div>

Yes this is what i have on my staging server

```auto
// image settings
    'thumbs' => [
        'quality' => 90,
        'srcsets' => [
            'default' => [
                '300w' => ['width' => 300],
                '600w' => ['width' => 600],
                '800w' => ['width' => 800],
                '1200w' => ['width' => 1200],
                '2000w' => ['width' => 2000]
            ],
            'avif' => [
                '600w' => ['width' => 600, 'quality' => 70, 'format' => 'avif'],
                '800w' => ['width' => 800, 'quality' => 70, 'format' => 'avif'],
                '1200w' => ['width' => 1200, 'quality' => 70, 'format' => 'avif'],
                '2000w' => ['width' => 2000, 'quality' => 70, 'format' => 'avif'],
            ]
        ]
    ],

```

Ive run into another issue when running the default image driver, GD. All my images in the panel are blurry and when uploading say a new footer jpg to test, its really blurry

Panel

 ![Screen Shot 2023-04-05 at 10.27.06 am](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/b/beab4f0d88a170eca6bb835c2ec7faa67cc0d3e8.jpeg)

 ![Screen Shot 2023-04-05 at 10.30.23 am](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/e/e04bcd913d1456018a037c6bbb15da9c7a3284a1.jpeg)

The original footer img of 2000px wide, 637kb is compressed to 5.8kb?

I’ve deleted the media library and refreshed.

I had this issue when testing locally, all my webp, jpg, png images were compressed to the max, this is honestly driving me crazy!

---

<div class="post-metadata">

**Author:** ![darcemac](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@darcemac](https://forum.getkirby.com/u/darcemac)\
**Post date:** [April 5, 2023, 6:48am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/22 "2023-04-05T06:48:41Z")

</div>

For what its worth, I rolled backed the Kirby version to 3.8.2, set thumbs to use default GD, used webp images throughout.

For my testing on shared PHP Apache servers, running the latest Kirby version 3.9, PHP 8.1, Avif doesnt work with the Default thumbs library of GD.

If using webp and the latest Kirby version, the webp images were badly compressed…

All the above is just my experience and others no doubt will have different results, so please take it with a pinch of salt.

Cheers

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [April 5, 2023, 9:33am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/23 "2023-04-05T09:33:55Z")

</div>

the simple image lib will fail silently afaik in dumping the raw jpeg - thats what you see in the inspector. an avif extension but a jpeg mime detected.

enable debug mode, add a **test.jpg** to your `/templates` folder and this code to any template and try it manually.

```auto
$image = imagecreatefromjpeg( __DIR__. '/test.jpg'); //read a jpg file
$i = imageavif($image, 'test.avif'); //save an avif file
var_dump($i);

```

---

<div class="post-metadata">

**Author:** ![darcemac](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@darcemac](https://forum.getkirby.com/u/darcemac)\
**Post date:** [April 5, 2023, 1:35pm UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/24 "2023-04-05T13:35:48Z")

</div>

Hi ya,

Ok, I’ve setup a copy of my existing site locally with the latest version of Kirby 3.9.3, PHP 8.1 etc.

The var dump, returns true. It also returns true for Kirby 3.8.2

As another side issue, for me, the latest version of Kirby compresses webp images much more than 3.8.2, 3.8.4, 3.9.3

Kirby 3.9.3  
image-2000x.webp 37.96kb

Kirby 3.9.2  
image-2000x.webp 240.67kb

Kirby 3.8.4  
image-2000x.webp 240.67kb

Kirby 3.8.2  
image-2000x.webp 240.67kb

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [April 5, 2023, 3:34pm UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/25 "2023-04-05T15:34:39Z")

</div>

looks to me like before 3.9.3 there is no compression. what is the size of the same image raw (jpg)?

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [April 5, 2023, 3:36pm UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/26 "2023-04-05T15:36:37Z")

</div>

> [@darcemac](#):
>
> The var dump, returns true. It also returns true for Kirby 3.8.2

that just means your local dev setup has avif support. nothing to do with kirby.

i would say it might fail on your production server.

---

<div class="post-metadata">

**Author:** ![darcemac](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@darcemac](https://forum.getkirby.com/u/darcemac)\
**Post date:** [April 6, 2023, 2:31am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/27 "2023-04-06T02:31:06Z")

</div>

Nope there’s compression.

As another example using Kirby 3.9.2, the starting jpeg was 586kb. It got compressed down to 296.25kb webp, so roughly 50%

With Kirby 3.9.3, again the starting image is 586kb, it was compressed down to 38.41kb webp, 6.5% of the original size

---

<div class="post-metadata">

**Author:** ![darcemac](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@darcemac](https://forum.getkirby.com/u/darcemac)\
**Post date:** [April 6, 2023, 3:03am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/28 "2023-04-06T03:03:50Z")

</div>

Yes you are right, it seems AVIF image support is disabled on the staging server.

Which is weird because when I’ve done a var dump on the Home page, \<?php var\_dump(gd\_info()); ?\> to check if GD is running, it says it supports webp, avif etc. GD Version 2.3.3, Webp Support =\> true, Avif Support =\> true.

Look I’m happy as webp seems to working fine, that should keep Google pagespeed happy. Although for me Kirby 3.9.3 compresses webp way too much!

VPS seems to be the way to go for AVIF support though.

 ![Screen Shot 2023-04-06 at 10.52.37 am](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/5/5795081f8788c2ab830ae351bb0984b8cfaa842c.jpeg)

---

<div class="post-metadata">

**Author:** ![darcemac](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@darcemac](https://forum.getkirby.com/u/darcemac)\
**Post date:** [April 6, 2023, 9:24am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/29 "2023-04-06T09:24:57Z")

</div>

Ok thanks for checking that. Based on the GD info dump, the server is running 2.3.3

 ![Screen Shot 2023-04-06 at 5.21.53 pm](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/5/59992f1db8631244d772b496060c92651a1d4848.jpeg)

[Previous page](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244.md?page=1)
