Skip to main content
Legend
February 19, 2017
Question

OT: Srcset

  • February 19, 2017
  • 3 replies
  • 2235 views

What width of images are you using, assuming you are using 3 - desktop, tablet, mobile?

I just saw one of the companies I follow are now using srcset, so its time for me to follow. I think. Mind they are not using it very well as they are just resizng the orginal images width (quick and very dirty) so by time it gets to tablet and smart phone it looks stupid. The only way is to individually crop the image if you want to maintain a sensible ratio of height to width.

At this stage I'm not concerned with retina, just need to keep it simple to try and save on download time.

Os

    This topic has been closed for replies.

    3 replies

    pziecina
    Legend
    February 19, 2017

    osgood_  wrote

    At this stage I'm not concerned with retina, just need to keep it simple to try and save on download time.

    This is built in to the browser calculation for which image to display, and is why many current examples of using srcset are wrong.

    Info, warning when using resolution images, (1x, 2x etc) - Edge, Firefox will use the image with the resolution you say it is. Chrome, Opera will use the image that best fits in the defined area for the image, modified by download speed and resolution even when using a desktop browser.

    osgood_Author
    Legend
    February 19, 2017

    pziecina  wrote

    osgood_   wrote

    At this stage I'm not concerned with retina, just need to keep it simple to try and save on download time.

    This is built in to the browser calculation for which image to display, and is why many current examples of using srcset are wrong.

    Info, warning when using resolution images, (1x, 2x etc) - Edge, Firefox will use the image with the resolution you say it is. Chrome, Opera will use the image that best fits in the defined area for the image, modified by download speed and resolution even when using a desktop browser.

    I'm not really using that, I'm currently going with:

    img src="image_large_2000.jpg" alt=""

    srcset ="image_large_2000.jpg 2000w,

    image_medium_1000.jpg 1000w,

    image_small_500.jpg 500w"

    />

    pziecina
    Legend
    February 19, 2017

    I would not worry about image width, use what you want that fills the respective area. Remember on desktop or larger your user will normally be on a home/office broadband connection, so speed and bandwidth is not a problem.

    Also you can have as many image src's as you like in the srcset selection.

    pziecina
    Legend
    February 19, 2017

    I'm on my iPad at the moment, so specifics are only what I can remember.

    Nancy's info is usefull, but only if you are using the resolution srcset, which is not the most usefull except in limited circumstances, (plus i would, Not recommend using Ps's settings, but that another subject).

    The srcset atribute you should be looking at using is the 'sizes' atribute, which functions the same as a css media-query, but is part of the html srcset, (in fact the code is almost the same).

    If you look at the responsive image working group, (the ones who developed srcset and picture) you will see an example of using sizes -

    https://responsiveimages.org

    Basically you are creating an image that is specific in size to the device viewport, but don't forget that ppi will also be calculated by the drowser/device when it decides which image to download for use.

    Nancy OShea
    Community Expert
    Community Expert
    February 19, 2017

    In Phothsop, I use ExportAs 1x,  2x and 3x. 

    For a full sized, square product image, I would probably use @1x 500 x 500,  @2x 700 x 700 and @3x 900 x 900 adjusting quality slider down to around 100-150KB for the largest image.   The smallest image around 30-40 KB.

    Nancy

    Nancy O'Shea— Product User & Community Expert
    osgood_Author
    Legend
    February 19, 2017

    So you're using 900px, 700px and 500px, is 900px wide enough for large screens, without it breaking down?

    I was thinking of using 2000px 1000px and 500px myself.

    Nancy OShea
    Community Expert
    Community Expert
    February 19, 2017

    For a full-width banner?

    My example is for a product image which doesn't consume 100% of viewport.  More like 30-50% depending on layout.

    Nancy

    Nancy O'Shea— Product User & Community Expert