The new Media Gallery provides an Image Optimization feature, which improves performance and decreases media file sizes on the storefront. This optimization is enabled by default and can be modified in the store configuration settings.
On the Admin sidebar, go to Stores > Settings > Configuration.
In the left panel, expand Advanced and choose System.
Expand Media Gallery Image Optimization and do the following:
When Media Gallery Image Optimization functionality is enabled, an optimized copy of an image is automatically inserted in the content from the Media Gallery instead of the original file.
When the Maximum Width and Maximum Height values are changed in the configuration, it updates all the existing optimized images that were previously inserted.
The Media Gallery Image Optimization requires that the
media.gallery.renditions.update queue consumers are running for regenerating optimized images when configuration is changed. See Manage message queues documentation for more details.