A theme-component experiment is underway to introduce opt-in image compression, resizing, and optimization on the client side before uploading. The goal is to assess its usefulness and potentially add it to the core for version 2.8.
Key Points
A simple checkbox in the upload modal will allow users to control client-side optimization.
The initial focus is on optimizing JPEGs, with MozJPEG used for re-encoding.
Tests have shown a significant reduction in image size (<30%) with minimal processing time (<10s) on mid-range devices.
sam and omarfilip suggest making this feature 100% automatic for certain cases, with a heuristic to ensure images adhere to site settings.
AdamAndrews proposes an admin option to enable automatic compression for images exceeding site settings.
Falco announces the feature is almost ready for testing and provides a link to the GitHub pull request.
This is a RFC for opt-in image compression/resize/optimization on the client side before the upload process. This will be experimented with using a theme-component. If proven useful, we will consider adding this feature in core for 2.8.
UI
Users will be able to control client side optimization via a simple checkbox in the upload modal
I am not sure if this should be an end user option, especially since they might just be cutting and pasting. Instead I think this is a site-operator kind of thing.
How much should images be optimized prior to uploading: “noting|a bit|a lot” …
Name/value and default pending.
The results look quite excellent! Also, in combination… maybe we make this 100% automatic for certain cases? You set the “maximum” size of images on your forum to 2000KB and we have a heuristic that kicks in and makes sure we take care of stuff.
It would be useful to have this as an admin option to enable where anything that exceeds site’s dimension/size settings gets automatically compressed. For more image intensive sites wouldn’t want this on all the time, but instead to cover use cases where less savvy users don’t need to worry about resizing.