How do I use the latest image code on my theme update?

Shopify’s latest image code.

If you update your theme so please use this latest image code:

{{ section.settings.image | image_url: width: 3840 | image_tag:
loading: ‘lazy’,
height: height,
sizes: “100vw”,
widths: ‘375, 550, 750, 1100, 1500, 1780, 2000, 3000, 3840’
}}

Certainly! The code you provided is using Shopify’s latest image code syntax. It fetches the image specified in the section.settings.image variable and generates an optimized image URL with the desired width of 3840 pixels.

Here’s the updated image code with the specified options:

{{ section.settings.image | image_url: width: 3840 | image_tag:
  loading: 'lazy',
  height: height,
  sizes: "100vw",
  widths: '375, 550, 750, 1100, 1500, 1780, 2000, 3000, 3840'
}}