Huh, I had to spend almost an hour before I found crp_get_image_html and I am going to use it π
So I am closing this ticket in order not to bother the author π
Plugin Author
Ajay
(@ajay)
@grzegorzjanoszka
Sorry for the delay. Glad to know you found it. Am curious as to what code you’re using to add the avif support
I am using go-avif (https://github.com/Kagami/go-avif/), but I am looking for something else as it is huge memory requirements – a 1MB JPG may take like 4-6 GB of RAM to convert.
And around it my dirty code around some hooks. The only issue I have is the WP editor:
https://core.trac.ww.wp.xz.cn/ticket/51417
Plugin Author
Ajay
(@ajay)
I see. You’re in way advanced territory vs what I know π
Well, the JPG standard is in retreat. I have put on my website one test image with picture tag presenting three images – avif, webp and jpg fallback.
The data for today:
JPG: 177
WEBP: 697
AVIF: 213
So old good JPG is the last. WEBP currently leads because of mobile Chrome (not everyone has updated yet) and Firefox which supports AVIF but it is disabled by default in the config.
Most of images I have in AVIF and JPG and I graph their numbers. The average for last 36 hours is 27 JPG’s and 9 AVIF in a unit of time.
When most mobile devices will have new Chrome and Firefox will enable AVIF by default then AVIF numbers should be higher than JPG. And files are at least 30% smaller.
Plugin Author
Ajay
(@ajay)
that’s pretty good. What are you using to generate the webp and avif’s? I’m quite reluctant to pay for solutions at least at this stage for my personal blogs.
The webp’s are easy – php has a built-in function to deal with it. But I used the plugin media webp: https://ww.wp.xz.cn/plugins/media-webp/
It is old, not maintained and has one annoying bug, but it is very efficient.
I however don’t create any webp files for new images, but I keep them for images added earlier.
I do avif’s with go-avif (https://github.com/Kagami/go-avif/) – it is a CLI tool for Linux x64. The only issue is its huge RAM requirements.
Plugin Author
Ajay
(@ajay)
Thank you for this. I can see that avif is better which I understand as your approach.
I noticed that https://ww.wp.xz.cn/plugins/imagify/ is good for freely converting to webp and might give that a spin. My sites barely have any visitors so the performance optimisation might take me more time to do vs the slightly faster/incremental visitor count π
As far as I see that imagify sends your pictures somewhere to be optimized there. I don’t like it and all my plugins do local optimization. But well, if you don’t have shell access to the server then I guess it is easier.