Image Art Direction

Responsive Images gives us some great media capabilities, while I really like srcset & sizes for helping with media loading optimisation - it is the Picture element and it's power to enable us to be more expressive with our media that I am most excited.

Media Art Direction: In this example I am using media queries to change the visual payload to make it more appropriate for the available screen area:

How do you like them Apples?

The code behind this example, provides both image candidates for higher DPR and variable width viewports, but also requests different media sources, each being better attuned for the available viewport space.

      <source media="(max-width: 500px)"
                 2x" />
      <source media="(max-width: 780px)"
                  srcset=" 500w,
                 800w" />
      <source srcset=" 800w,
      <img src="" alt="How do you like them Apples?" />

Using Dynamic Media tools such as Cloudinary, can also provide object-aware smart cropping to help automatic and scale this approach.