[wp-trac] [WordPress Trac] #58960: Core cannot handle indexed 8bit PNG, severe implications on filesize and website speed

WordPress Trac noreply at wordpress.org
Wed Aug 2 14:52:42 UTC 2023


#58960: Core cannot handle indexed 8bit PNG, severe implications on filesize and
website speed
--------------------------+-----------------------------
 Reporter:  tgsrvrs       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  6.2.2
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 After countless hours of investigating, testing and searching the web I
 came to the conclusion that WP is not able to handle color indexed 8bit
 PNGs properly.
 The calculated downscaled images are not only a few bytes, but severely
 bigger than the original.

 This results out of my conclusion and tests that WP is generating full-
 spectrum grayscale images out of the indexed files.

 As you cannot simply deactivate srcset and other functionality for
 dedicated files this leads to a plethora of problems I consider severe.
 Way bigger files, srcset problems and ultimately website speed problems.
 Because of this nature this can only be handled in core. Or if there is
 any other workaround please tell me.

 We are not talking marginal numbers here, baseline is a 256 color 8bit
 indexed PNG

 **17% downscale : 328% filesize
 58% downscale : 204% filesize
 79% downscale : 148% filesize
 **


 {{{
 Wordpress 6.2.2, no plugins enabled


 Active editor   WP_Image_Editor_Imagick
 ImageMagick version number      1809
 ImageMagick version string      ImageMagick 7.1.1-15 Q16-HDRI x86_64 21298
 https://imagemagick.org
 Imagick version 3.7.0
 }}}

 Replication possibility : Always, just upload an indexed PNG to the media
 library
 Result : Severely bigger files for the downscaled images than the original
 file

 Example :
 Original file : 45 kB
 1180x685 downscale : 148kB
 600x348 downscale : 92kB
 300x174 downscale : 67kB

 Although this has no security implications or the like I consider this a
 major bug as there is nothing you can do as a user to circumvent the
 results in any way.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58960>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list