Hey
@digitalpoint, thanks for the follow-up.
If the uploaded image is huge, ideally, I would want to downsize it anyway, even if it gets offloaded elsewhere. You only need an image that is no bigger than max 1920px in width anyway, so any images bigger than that are just unnecessary, because they take up unnecessary space.
Even if they are offloaded somewhere else, there will be a time when you'll need to move them, so offloading images that are generally huge in size, with bigger dimensions than needed is just pointless in my opinion.
I know that WordPress generates and serves various image sizes. I've learned this the hard way when I was starting out and experimenting with different plugins, especially image grids etc, because I realised that most of these plugins also generate their own sizes. Then, I ended up with 20 different variants of a single image, so I guess you can imagine the size of the image folder when you have lets say 2000 images x 20 variants for each image. You are basically pushed to purchase the extra server storage because you're running out of space and resources, and that could get quite expensive. Not to mention doing backups, migrations etc. it's just a pain.
I absolutely hate this. I switched all the custom image sizes off and started looking into solutions where an image is uploaded in its original size and only keeps one single variant (in my case, it also gets additionally downsized to 1920px), and then it's served from a CDN in the exact size of a user's viewport.
So basically, if I'm looking at the website from a mobile, then the CDN automatically serves mobile-sized images.
A really great, tried and tested example of this is the Shortpixel's Adaptive Images plugin:
https://shortpixel.com/products/shortpixel-adaptive-images.
It does exactly this, and really well. The yearly subscription is reasonable, but again, all images are kept on your server.
They also offer an additional service to offload your images onto their server, from where the images are then served, but that gets a lot more expensive.
Lately, I started experimenting with Cloudflare and Cloudflare Images because CF can do exactly the same thing, however as of now, most CF plugins are not there yet. In terms of the level of automation, just like Shortpixel for example.
I'm still currently experimenting with the Offload & Optimise CF Images plugin:
https://wordpress.org/plugins/cf-images/, which so far works quite well. This is currently the only plugin that offloads images to Cloudflare Images automatically. From here, images are then served to the user in Webp and AVIF and also in the size that fits the user's viewport. It works well, but with a large number of images and a high-traffic site, it may get quite expensive.
I'm basically trying to find an alternative to Shortpixel's Adaptive Image or the above CF Images plugin, but with the possibility of using R2, and that's why your plugin seems pretty interesting.