[wp-trac] [WordPress Trac] #35725: Add WebP support.

WordPress Trac noreply at wordpress.org
Mon Mar 15 10:11:59 UTC 2021


#35725: Add WebP support.
-------------------------------------------------+-------------------------
 Reporter:  markoheijnen                         |       Owner:
                                                 |  adamsilverstein
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.8
Component:  Media                                |     Version:  3.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch 2nd-opinion needs-testing  |     Focuses:
  has-unit-tests                                 |
-------------------------------------------------+-------------------------

Comment (by marylauc):

 Replying to [comment:86 adamsilverstein]:
 > > Regarding CPU/memory requirements, webp generally uses about 40% less
 memory than jpeg encoding, but is 2x to 3x more cpu intensive.
 >
 > Very interesting @marylauc! Is the tradeoff intentional, eg. has WebP
 been optimized to reduce memory usage at the expense of CPU use?
 The increased CPU usage is a consequence of how webp works. Modern image
 codecs work by having multiple ways of encoding an area of the image, and
 the encoder has to try many different methods to find the best one. This
 is in large part how a better compression is achieved, so webp will always
 be slower than jpeg no matter how much we optimize it.

 Regarding memory, it's the other way around, jpeg encoders are usually
 optimized for speed and use more memory as a trade off.

 > > These images would typically be encoded losslessly anyway (using png
 or webp lossless).
 >
 > This brings up a good point, so far we have thought mostly about jpgs.
 In addition, when users upload a lossless format image, we should take
 advantage of WebP lossless.

 For lossless, CPU and memory usage are roughly on par with a normal png
 encoder, maybe a little bit higher. And webp is much faster than png
 optimizers, and offers a larger compression gain.

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


More information about the wp-trac mailing list