[wp-trac] [WordPress Trac] #57238: Criteria for Responsive Images of WebP: Preserve Alpha + Preserve Lossless + Smaller in size than original

WordPress Trac noreply at wordpress.org
Thu Feb 2 17:40:08 UTC 2023


#57238: Criteria for Responsive Images of WebP: Preserve Alpha + Preserve Lossless
+ Smaller in size than original
-----------------------------+------------------------------
 Reporter:  abitofmind       |       Owner:  adamsilverstein
     Type:  feature request  |      Status:  assigned
 Priority:  normal           |   Milestone:  Future Release
Component:  Media            |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  performance
-----------------------------+------------------------------

Comment (by adamsilverstein):

 Thanks for opening this @abitofmind!

 I'm curious about the environment you are testing in because format
 support may depend on the underlying GD or Imagick library your web server
 has. You can find this information under Tools->Site Health->Info->Media
 Handling.

 > ✅ Preserve the alpha channel → To maintain layout/design capabilities
 > ✅ Lossless original should result in lossless sized versions → To
 preserve full quality (e.g. screen designs, diagrams, etc)
 > ✅ File size of smaller sized versions should never be larger than the
 original → Else the purpose of Responsive Images to conserve bandwidth is
 moot.

 I think you are raising three separate issues:

 1. Alpha channel preservation - this should already work with both GD and
 Imagick, I will test to verify
 2. Lossless format -> output should be lossless. This is a little tricky -
 first, we do support with Imagick which supports lossless (with a quality
 setting of 100); GD requires PHP 8.1, we can probably add support for this
 maybe by checking for the new `IMG_WEBP_LOSSLESS` constant (see
 https://github.com/php/php-src/pull/7348. I can work on a patch for that!
 3. File size: we don't currently check file sizes at all and that isn't
 really the purpose of the responsive images entirely. Is this directly
 related to WebP?

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


More information about the wp-trac mailing list