[wp-trac] [WordPress Trac] #45406: Add additional default image sizes for srcset to accommodate wider viewports

WordPress Trac noreply at wordpress.org
Sat Nov 24 00:23:02 UTC 2018


#45406: Add additional default image sizes for srcset to accommodate wider
viewports
--------------------------+------------------------------
 Reporter:  mor10         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  5.0
 Severity:  major         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by kevinwhoffman):

 One issue I see with the proposed sizing array is that the image sizes get
 farther apart as they get larger, when they should instead get closer
 together. The reason for this is that small variations in image width at
 large resolutions result in drastic increases in resolution and therefore
 file size. This effect is outlined nicely in this article:

 https://cloudfour.com/thinks/responsive-images-101-part-9-image-
 breakpoints/#memory-usage-influencing-the-distribution-of-image-
 breakpoints

 As an example using the proposed array, consider the jump in resolution
 between the two consecutive image sizes at a 3:2 aspect ratio.

 ----

 **Example 1 Comparing Consecutive Medium Sizes**

 1125X750 = 843,750

 1440x960 = 1,382,400

 1,382,400 - 843,750 = 538,650 pixel difference between two consecutive
 sizes

 ----

 **Example 2 Comparing Consecutive Large Sizes**

 2880x1920 = 5,529,600

 3840x2560 = 9,830,400

 9,830,400 - 5,529,600 = 4,300,800 pixel difference between two consecutive
 sizes

 ----

 **Results**

 4,300,800/538,650 = 798% more pixels are added between the large jump
 compared to the medium jump, which emphasizes the importance of spacing
 larger image sizes closer together.

 ----

 Correcting this issue would require many more image sizes to be added
 closer together for large viewports. This sheds light on an underlying
 problem of generating the same image sizes for all uploads in WordPress
 since there is no way to exclude those large image sizes for the majority
 of use cases that don't need them.

 Striking the right balance between the number of image sizes generated and
 their effect on page weight is going to be extremely difficult, especially
 because this solution must be designed without the knowledge of a site's
 page layout. I'm not sure there is a one-size-fits-all solution, but I do
 think the jumps between sizes should be reconsidered if we are going to
 add more default image sizes.

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


More information about the wp-trac mailing list