Long ago when getting on the internet meant tying up the phone line, images on the web were simple. You would upload a jpeg or gif and move along. Webpages took forever to load. Things were simple, but insanely slow.
Later on the png appeared and compressing images server side became popular. CMS tools like WordPress began creating different sizes for each image. And/or, as you uploaded the image it would be sent to a third party to compress, then sent back to your server.
Today, people still compress server side and/or use a CDN like Cloudflare to serve the appropriate type of image depending on the situation.
The reason these things are done is because we want websites to be fast and a small image size helps to make that happen. But, a standard jpeg or png is too large, even compressed. So, Google created the WebP format which is much smaller. It’s also widely supported now.
Then the AVIF format appeared. It’s even smaller than WebP but still looks great. It’s also supported in all modern web browsers but as of writing this article, AVIF won’t work in link previews at your favorite social media site and may not work in emails or other applications.
One typical modern solution is this:
Upload image
Server side convert image to WebP or AVIF, plus make a JPEG fallback – the fallback is served places where WebP/AVIF isn’t supported
There are WordPress plugins that do this.
But, this approach, in my opinion, isn’t quite good enough. Because you’re wasting server resources during the conversion process.
WordPress thought the same and that’s why as of WordPress 7.1, when possible, images are processed in the browser (aka client side). It is compressing, creating different sizes, then uploading. But, what core still doesn’t do is convert to WebP or AVIF if the image is not already one of those. Core also does not create a JPEG fallback image for edge cases.
Earlier this year before I knew WordPress was switching to client-side image processing I created a plugin called Menagerie. It processed images client side and converted to AVIF or WebP. But now that WordPress 7.1 has client side processing built in, I stripped all of that type of logic out of the plugin and rebuilt it as a companion to what 7.1 already does.
WordPress 7.1 handles the client side stuff and creates the different image sizes. Menagerie steps in to tell WordPress what to convert to, AVIF or WebP, plus it creates the JPEG fallback. On top of that it provides settings for these steps as well as your Open Graph link preview images. It also shows toast notices so that you know if the conversion was successful or not.
In short, WordPress handles the bulk of the work, more client side stuff happens which is cool, and Menagerie adds a little more to make your WordPress image processing experience amazing.