[wp-trac] [WordPress Trac] #52867: Add capability to set default format for image sub-sizes. (was: Use WebP as default format for image sub-sizes (when available).)

WordPress Trac noreply at wordpress.org
Tue Mar 30 21:17:35 UTC 2021


#52867: Add capability to set default format for image sub-sizes.
-------------------------------------------------+-------------------------
 Reporter:  adamsilverstein                      |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests dev-        |     Focuses:
  feedback                                       |
-------------------------------------------------+-------------------------
Description changed by adamsilverstein:

Old description:

> Follow up to #35725 where we introduced support for WebP images. Please
> review this ticket first as many of the changes proposed here have
> already been discussed extensively there!
>
> By switching to WebP, users won't need to do anything and will benefit
> from faster sites because images will be 25-40% smaller, all with no loss
> of quality. Hosts will benefit from reduced memory usage for compression,
> and reduced storage and bandwidth requirements for images.
>
> By using WebP as the default image format:
>
> * Uploaded images are converted to smaller sub-sizes - these images will
> now use the WebP format if the server supports it.
>   * Note both GD and Imagick support WebP lossy and lossless, however
> only Imagick supports animated images.
> * A filter controls the type re-mapping and can be used to opt out of the
> feature entirely, or on a per image or image type basis (eg only convert
> jpegs).
>
> Considerations:
> * We need to research the best compression level to use for WebP. In
> particular, we need to pick a compression level that results in images
> that are very close to the images our current compression defaults
> produce. Some details on testing methodology, plus a link to research
> with a set of test images we can use in this
> [https://core.trac.wordpress.org/ticket/35725 comment].
> * Some browsers still don't support WebP, so we should consider providing
> a https://github.com/chase-moskal/webp-hero shim] (behind feature
> [https://github.com/Modernizr/Modernizr/blob/master/feature-
> detects/img/webp.js detection])for sites that need to support these
> browsers, or whether letting these sites opt out is sufficient.
> * Disabling the feature is a one line code change, still we should
> release a plugin non-technical users can install to disable the feature.
> * Testing, testing, testing!

New description:

 Introduces a new filter that enables setting a default sub-size image
 output format when uploading images.

 This enables testing WebP (or other image formats) as the default output
 format.

 Follow up to #35725 where we introduced support for WebP images.

 By switching to WebP as their default output format, users won't need to
 do anything and will benefit from faster sites because images will be
 25-40% smaller, with no loss of quality. Hosts will benefit from reduced
 memory usage for compression, and reduced storage and bandwidth
 requirements for images.

 By using WebP as the default image format:

 * Uploaded images are converted to smaller sub-sizes - these images will
 now use the WebP format if the server supports it.
   * Note both GD and Imagick support WebP lossy and lossless, however only
 Imagick supports animated images.


 Considerations:
 * We need to research the best compression level to use for WebP. In
 particular, we need to pick a compression level that results in images
 that are very close to the images our current compression defaults
 produce. Some details on testing methodology, plus a link to research with
 a set of test images we can use in this
 [https://core.trac.wordpress.org/ticket/35725 comment].
 * Some browsers still don't support WebP, so we should consider providing
 a https://github.com/chase-moskal/webp-hero shim] (behind feature
 [https://github.com/Modernizr/Modernizr/blob/master/feature-
 detects/img/webp.js detection])for sites that need to support these
 browsers, or whether letting these sites opt out is sufficient.
 * Disabling the feature is a one line code change, still we should release
 a plugin non-technical users can install to disable the feature.
 * Testing, testing, testing!

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52867#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list