Implemented Google WebP Support

Floren

Well-known member
This would an amazing enhancement for attachments, especially for sites that use many large pictures.
WebP is a new image format that provides lossless and lossy compression for images on the web. WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at equivalent SSIM index. WebP supports lossless transparency (also known as alpha channel) with just 22% additional bytes. Transparency is also supported with lossy compression and typically provides 3x smaller file sizes compared to PNG when lossy compression is acceptable for the red/green/blue color channels. Webmasters and web developers can use the WebP image format to create smaller and richer images that can help make the web faster.
GD (PHP 5.5) and ImageMagick are supporting WebP. This could be made as option available if PHP 5.5+ is detected. Many of us already use PHP 5.5 anyways.
 
Last edited:
Upvote 115
This suggestion has been implemented. Votes are no longer accepted.
WebP is also 10 years old! If AVIF is found to be more efficient and open, I do not see why they would not switch to it for things like YouTube! Chrome stable support avif already. Firefox needs a flag to be enabled. Good thing is Microsoft is involved (along with Netflix) so it should be natively supported on Windows as well. I was able to open AVIF files locally but I think that's probably because I have their AV1 codec installed.

Anyhow. With Apple support WebP in upcoming MacOS and iOS releases, I guess it would be logical for platforms like XenForo to focus on WebP for now. Really looking forward to a release where one would just be able to convert all uploaded images to WebP format (probably would require an addon though).

Cloudflare documentation also has references to AVIF so I imagine they would soon start using it on their paid image optimization services as well. Won't be long before they start landing in our browsers!
 
Cloudflare this week added support for AVIF delivery on their paid service Polish. Here I am hoping for XenForo to at least start treating WebP attachment as images if it is allowed as a supported file type 😪


Update. I forgot to add... If any addon developer is reading this post... How complicated it would be to do it through an addon? :D
 
Last edited:
Webp is already obsolete. Never had adoption... Other newer formats are better.

Still, a 3rd party solution is probably the way to go.
 
The goal isn't to optimize images. Many websites use the webp format and it is impossible to embed this pictures in a post.
If XF cannot support this format it could be a solution to change the extension to JPG because than embed images can be shown in the posts.
 
That's a hack. WebP is a superior format in every way and downgrading to some outdated format is not a solution for a better XenForo, but rather a stagnant one.

Let's just wait and see what v2.3 comprises. I wouldn't be surprised if they added WebP there.
 
my experience showed me that web is not good for SEO, after you convert jpeg to webp, google page speed will show - resize your pictures
this is what happened to me, after converting 200k jpeg photos to webp, the website disappeared from google search
luckily I backed up all photos, deleted all webp & returned jpeg, optimized to 30%
50kb photo after optimization 10-15kb
my website brought back to the top 3

that happened to website which is optimized for SEO & page speed 95 mobile 99 desktop. if I remove 18 pictures form the main page it's 100 on both.

so, think first before acting
 
my experience showed me that web is not good for SEO, after you convert jpeg to webp, google page speed will show - resize your pictures
this is what happened to me, after converting 200k jpeg photos to webp, the website disappeared from google search
luckily I backed up all photos, deleted all webp & returned jpeg, optimized to 30%
50kb photo after optimization 10-15kb
my website brought back to the top 3

that happened to website which is optimized for SEO & page speed 95 mobile 99 desktop. if I remove 18 pictures form the main page it's 100 on both.

so, think first before acting
Sounds more like you did not wait to get re-indexed, or did not have a sitemap that submitted the changes appropriately, that or you did not have redirects setup for the images.

Meaning your experiences have absolutely nothing to do with the adoption of WebP.
 
Yeah. WebP is now natively supported by Apple on both iOS and MacOS. Though devices running older OS would suffer.

Hopefully by next year, JXL would have widespread adoption as well. Though, a lot would depend upon Apple to support it on their ecosystem. AVIF looked good for a while but it seems like everyone is betting on JXL now. Google also has WP2 (WebP v2) in development which in my experience is pretty close to JXL. But WebP is a safe choice in 2021. Would be even great, if a future update would offer an option to convert/optimize all image uploads to WebP on upload.

It is kind of crazy that a simple web page could just become a 3-4MB download because one image was shared by a user taken from his phone when that image could be as small as 150-200KB in a more efficient format. Users are never going to optimize their images before upload. It has to be done server side. And just resizing the image dimensions is not good enough. Even the most basic conversion to WebP could save a lot of storage requirement for the forum owners. And bandwidth usage for both owners and visitors.
 
Last edited:

standards.png
 
Top Bottom