I'd really like to see us bring a module like TinyPNG, Images Optimizer or Image Optimize into Drupal Core.
I realize the many problems of tying in an external service, so really just want that type of basic processing that any image should have when it is uploaded to the web. It has to respect FOAF info of the file and be lossless. Would need to be able to be overridden in case there are problems. But most images uploaded to the web should be compressed first and most content authors don't do this or don't do it consistently.
There are great resources out there about why this is important for our planet https://serving.green/
There are terrific books on the subject (which I've contributed a bit to).
I've blogged a bit about approaches for Drupal here https://openconcept.ca/blog/mike/tips-sustainable-drupal-7-8-website
There's a really good tool to evaluate the carbon impact of your site here https://www.websitecarbon.com/
Even just from a financial point of view, this is costing users a ot https://whatdoesmysitecost.com/
Google's also making it much more important from an SEO perspective.
There are good summaries of best practices from PreviousNext. There's also stuff to be learned from WordPress.
Let's do what we can to bring in sustainability best practices into Drupal.
Comments
Comment #2
ndobromirov commentedThere is already a contributed module for that: https://www.drupal.org/project/imageapi_optimize.
It will not require any core interventions. On top of that to include this functionality in core will require installed systems to have the optimizer binaries installed and available on the hosting. This is not always the case for shared hosting plans.
With that said I like the idea having that in core as part of the fast by default initiative.
Comment #3
mgiffordThanks @ndobromirov - and ya, there are already contrib modules for this.
That said, if we add up all the known users of those modules there are only 16315 sites. That is basically nothing in the million or so known Drupal sites out there.
For something that benefits every site and has no downsides (that I can think of) really we should all be doing this by default. It shouldn't be an extra.
Love the idea of the fast by default initiative, but don't see docs for it anywhere. How do we loop this into that?
Comment #4
ndobromirov commentedComment #5
xjmUnder our continuous upgrade path and deprecation policy, feature and API additions should be added with backwards compatibility in minor releases, so moving to 8.8.x. Thanks!
Comment #14
mgiffordComment #15
mgiffordLooking back at this issue now.
ImageAPI Optimize looks quite flexible, it will work for D10 & 11 but does require another 3rd party system. It would be interesting to see if that could be incorporated into Drupal CMS but unsure if it would be a good candidate for Core. Image optimization should be easy, but building in a 3rd party into Core would be a problem (not matter which one).
Imagemagick could also do the trick, and has more installs.
Some MIT projects that might be worth looking at: