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 in the Configuration Guide for more details.