# 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:** 20\
**Page:** 1

<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:** [March 31, 2023, 3:16am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/1 "2023-03-31T03:16:21Z")

</div>

Possible stupid question but I have a site on a staging server and when tested with Google Pagespeed, its doesn’t register that I’m using Avif images.

When I view the image I can see that they have avif appended to the image, homepage-hero-2000x-q90.avif

When I open the image and try to save it, it downloads/saves as a jpeg.

When I do the same process locally, I’m able to save the image as a avif file.

I’m stumped, and possibly missing something really simple.

Thanks

---

<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:** [March 31, 2023, 5:45am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/2 "2023-03-31T05:45:16Z")

</div>

Which thumb driver are you using? And which Kirby version?

---

<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:** [March 31, 2023, 7:14am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/3 "2023-03-31T07:14:10Z")

</div>

Hey thanks for your response.

The thumb driver is IM, Kirby version is 3.8.2.

---

<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:** [March 31, 2023, 8:33am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/4 "2023-03-31T08:33:04Z")

</div>

if you are using apache maybe the header is not set see .htaccess file

> **[How to configure your web server to deliver AVIF images - ShortPixel Blog](https://shortpixel.com/blog/avif-mime-type-delivery-apache-nginx/)**
>
> ShortPixel Image Optimizer is able to create and serve AVIF files since version 4.22. The delivery can be done in two different ways: using the tag syntax or without altering the page code (via .htaccess). The recommended method is via .htaccess,...

---

<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:** [March 31, 2023, 8:58am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/5 "2023-03-31T08:58:56Z")

</div>

Hey thanks for your reply.

I added that to my .htaccess file, but it didnt seem to fix the issue.

Ive raised a ticket with my host.

Imagemagick is also enabled on my PHP options

---

<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:** [March 31, 2023, 9:32am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/6 "2023-03-31T09:32:15Z")

</div>

> [@darcemac](#):
>
> Imagemagick is also enabled on my PHP options

ImageMagick is not a PHP option, not to be confused with PHP imagick extension.

---

<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:** [March 31, 2023, 11:57am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/7 "2023-03-31T11:57:14Z")

</div>

Sorry by option I meant extension. So you’re saying ImageMagick or IM is not to be confused with the PHP imagick extension. From what Ive read the Imagick native PHP extension uses the ImageMagick API, surely it does the same thing?

---

<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:** [March 31, 2023, 12:02pm UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/8 "2023-03-31T12:02:42Z")

</div>

Kirby uses the ImageMagick binary via an exec() command. If the PHP imagick extension is installed, this won’t help you. So you need to have ImageMagick installed on your 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:** [March 31, 2023, 12:16pm UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/9 "2023-03-31T12:16:14Z")

</div>

Ok sure, thanks for clearing that up for me. I will ask the server techs to install ImageMagick for me.

Thanks again, hopefully this fixes the issue 🤞

---

<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 3, 2023, 3:53am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/10 "2023-04-03T03:53:15Z")

</div>

Hi again,

When you say “you need to have ImageMagick installed on your server”, is this usually installed on VPS hosting?

Ive only generally used shared PHP hosting for Wordpress given the nature and size of projects I work on.

I asked tech support on the web host I generally use and their response was:

"It’s quite unusual that the software invokes a standalone binary from an exec() function, instead of using the official extension integrated into PHP.

There won’t be a way to install the imagick binary package on the shared cPanel Hosting servers, you would need a VPS to have your own isolated environment you can install those in."

---

<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 3, 2023, 4:28am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/11 "2023-04-03T04:28:28Z")

</div>

I think you’ve answered my question here - [AVIF Image generator BIN? - #8 by texnixe](https://forum.getkirby.com/t/avif-image-generator-bin/27524/8)

Thanks again for your help!

---

<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:** [April 3, 2023, 6:43am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/12 "2023-04-03T06:43:21Z")

</div>

Just as addendum: In Kirby 3.9.3 we updated the SimpleImage dependency to the latest version, which now supports AVIF. So if you update to 3.9.3 and then use the standard `gd` driver, AVIF will work.

---

<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 4, 2023, 3:30am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/13 "2023-04-04T03:30:27Z")

</div>

Ok great. Ive tested locally and I can see in the Network tab all the images are avif which is great.

For the server settings on a shared PHP host, do I need to enable the GD extension?

---

<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:** [April 4, 2023, 4:54am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/14 "2023-04-04T04:54:05Z")

</div>

> [@darcemac](#):
>
> do I need to enable the GD extension?

It’s usually enabled, but better double-check.

---

<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 4, 2023, 5:20am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/15 "2023-04-04T05:20:06Z")

</div>

So Ive checked and its enabled, even did a GD PHP dump and Avif support is true.

But I note in another post you said “Even if turned on by your provider, it still wouldn’t work because it is not supported by SimpleImage, the library used by Kirby’s GD driver”

> [@AVIF files not resized or converted when using thumbs](https://forum.getkirby.com/t/avif-files-not-resized-or-converted-when-using-thumbs/26954/13):
>
> @mrfreedom As I wrote above, that is not the only problem. Even if turned on by your provider, it still wouldn’t work because it is not supported by SimpleImage, the library used by Kirby’s GD driver.

Maybe I’m better off just using Webp as standard, the only thing for me is that when using the standard GD driver and webp, it compresses the .webp images so that they are almost unusable and this is with ‘quality’ =\> 90, in my config file.

---

<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:** [April 4, 2023, 6:49am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/16 "2023-04-04T06:49:43Z")

</div>

As I wrote, the new version of SimpleImage present in Kirby 3.9.3 supports AVIF

---

<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 4, 2023, 6:54am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/17 "2023-04-04T06:54:01Z")

</div>

Yes I get that, it works locally for me but when testing on a shared server, Kirby 3.9.3, PHP 8.1 with GD enabled and WebP support, Avif support true, its still loading the ‘avif’ images as jpg.

Ive cleared my cache etc

I dont mean to be difficult, so my apologies. Would love to get this, webp, avif image formats working on shared PHP hosting as that’s mostly what my clients have budgets for.

---

<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:** [April 4, 2023, 7:11am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/18 "2023-04-04T07:11:02Z")

</div>

Then the only thing I can think of is that the version of GD on the server does not support it.

---

<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 4, 2023, 7:29am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/19 "2023-04-04T07:29:59Z")

</div>

> [@texnixe](#):
>
> In Kirby 3.9.3 we updated the SimpleImage dependency to the latest version, which now supports AVIF. So if you update to 3.9.3 and then use the standard `gd` driver, AVIF will work.

Hmm ok, for info the server is running GD Version 2.3.3

---

<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:** [April 4, 2023, 11:56am UTC](https://forum.getkirby.com/t/avif-images-not-getting-picked-by-up-google-pagespeed/28244/20 "2023-04-04T11:56:00Z")

</div>

> [@darcemac](#):
>
> 2.3.3

According to the [changelog](https://libgd.github.io/), AVIF support was added in 2.3.2, so you should be fine. Have you removed the `im` driver from your config?

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