Sirv Content Hub
Tutorial
February 16, 2026

Shopify Image Optimization: Speed Up Your Store in 2026

How to optimize Shopify product images for faster load times and higher conversions. Covers dimensions, formats, Liquid tips, and CDN setup.

S
Sirv Team

How fast does your Shopify store load on a phone? If you don’t know, your customers do. A one-second delay in page load can cut conversions by 7%. And on most Shopify stores, product images make up the bulk of page weight.

Image optimization is the single highest-impact speed improvement you can make. This tutorial walks through everything from choosing the right dimensions to serving next-gen formats and measuring results.

Why This Matters So Much for Shopify

Shopify stores are image-heavy by nature. A single product page might load a hero banner, multiple product photos, variant swatches, trust badges, and lifestyle shots. Without optimization, that page can easily blow past 5 MB. On a mobile connection, that’s brutal.

Google uses Core Web Vitals as a ranking signal. Largest Contentful Paint (LCP) is directly tied to how fast your biggest image loads. Slow LCP means lower search rankings, higher bounce rates, fewer sales.

The paid advertising angle matters too. Google Ads and Meta both factor landing page speed into quality scores. Slower pages = higher CPCs and lower ad rank. Optimizing your product images improves organic and paid performance at the same time.

What Shopify Gives You Out of the Box

Shopify handles some image basics that many store owners don’t realize they already have:

  • Automatic resizing via URL parameters. Shopify’s CDN generates multiple sizes and lets you request specific widths through Liquid filters.
  • WebP conversion in modern themes. Online Store 2.0 themes using image_url and image_tag filters serve WebP to supported browsers.
  • CDN delivery. Every Shopify store serves assets through Shopify’s global CDN.

But there are real gaps. Shopify doesn’t serve AVIF, which offers 30-50% better compression than WebP for photos. It applies a fixed compression quality instead of analyzing each image individually. Lazy loading depends entirely on your theme. And there’s no built-in 360 product spins or deep zoom, features that can make a massive difference in product page engagement.

What Dimensions Should You Use?

Using correctly sized images prevents the browser from downloading pixels it’ll never display. Here are the recommended dimensions for common Shopify image slots:

Image TypeRecommended SizeAspect Ratio
Product images2048 x 2048 px1:1 (square)
Collection banners1920 x 720 px8:3
Hero/slideshow banners1920 x 1080 px16:9
Blog featured images1200 x 630 px~1.9:1
Favicon32 x 32 px1:1

For product images, 2048 x 2048 is the sweet spot. Large enough for pinch-to-zoom on mobile, sharp on retina displays, but not excessively big. Square images also give you the most flexibility across themes and social sharing.

Keep individual files under 500 KB after compression. Under 200 KB is ideal for product photos. And never upload anything wider than 4472 pixels, that’s Shopify’s hard limit.

Format Best Practices: WebP and AVIF

WebP is 25-35% smaller than equivalent JPEGs with no visible quality loss. AVIF pushes that further, often hitting up to 50% savings over JPEG. Browser support for both is now excellent: WebP is universal, AVIF works in Chrome, Firefox, and Safari 16+.

Shopify themes built on Online Store 2.0 support automatic WebP conversion when you use the right Liquid tags:

{{ product.featured_image | image_url: width: 800 | image_tag: loading: 'lazy' }}

This tells the browser to request WebP if supported, with JPEG as a fallback. For stores that want AVIF support, you need an external image CDN that handles format negotiation automatically based on the browser’s Accept header.

Liquid Template Tips for Responsive Images

Comfortable editing your Shopify theme? Liquid templates give you fine-grained control over how images load. Here are patterns that make a real difference.

Responsive images with srcset:

<img
  src="{{ product.featured_image | image_url: width: 800 }}"
  srcset="
    {{ product.featured_image | image_url: width: 400 }} 400w,
    {{ product.featured_image | image_url: width: 800 }} 800w,
    {{ product.featured_image | image_url: width: 1200 }} 1200w
  "
  sizes="(max-width: 600px) 400px, (max-width: 1024px) 800px, 1200px"
  alt="{{ product.featured_image.alt | escape }}"
  loading="lazy"
  width="{{ product.featured_image.width }}"
  height="{{ product.featured_image.height }}"
>

Prioritize above-the-fold images:

{% for image in product.images %}
  <img
    src="{{ image | image_url: width: 800 }}"
    loading="{% if forloop.first %}eager{% else %}lazy{% endif %}"
    fetchpriority="{% if forloop.first %}high{% else %}auto{% endif %}"
    alt="{{ image.alt | escape }}"
    width="{{ image.width }}"
    height="{{ image.height }}"
  >
{% endfor %}

The key details: loading and fetchpriority. The first product image should load eagerly with high priority because it’s almost always the LCP element. Everything else should lazy load.

Always include explicit width and height attributes. This prevents Cumulative Layout Shift (CLS) by reserving space for the image before it loads.

Compress Before Upload vs. CDN-Based Optimization

Two approaches to reducing file sizes:

Pre-upload compression means running images through tools like Squoosh, TinyPNG, or ImageOptim before adding them to Shopify. You get full control over quality settings, but it adds a manual step to every product upload.

CDN-based optimization offloads the work entirely. An image CDN sits in front of your images and automatically compresses, converts to the best format based on browser support, and resizes on the fly. Upload your full-quality originals once and the CDN handles everything.

For stores with large catalogs, CDN-based optimization is far more practical. It also future-proofs you. When browsers adopt new formats, the CDN adapts without you re-exporting a single image.

Using Sirv with Shopify

For stores that want to go beyond Shopify’s built-in capabilities, Sirv has a dedicated Shopify app that fills several gaps.

360-degree product views. Sirv’s 360 spin viewer lets customers rotate products interactively. You upload a set of images taken from different angles (typically 24-72 frames shot on a turntable), and the viewer handles the rest:

<div class="Sirv" data-src="https://demo.sirv.com/example.spin"></div>
<script src="https://scripts.sirv.com/sirvjs/v3/sirv.js"></script>

The viewer is responsive, supports touch gestures on mobile, and loads frames progressively so it doesn’t block the initial page render.

Deep zoom for product detail. For products where fine detail matters (jewelry, fabrics, electronics), deep zoom lets customers magnify far beyond standard zoom. The viewer loads a low-res preview first, then streams high-res tiles on demand. You can offer 50-megapixel zoom without destroying page speed:

<div class="Sirv" data-src="https://demo.sirv.com/product-detail.jpg"
     data-options="zoom.mode:deep"></div>

Automatic image optimization. Once connected, Sirv serves your product images in WebP or AVIF with intelligent per-image compression. Images are delivered from a global CDN, so load times are fast regardless of where your customer is browsing from.

Measuring Your Results

After making changes, measure the impact:

  • Google PageSpeed Insights. Enter your product page URL and check LCP. Aim for under 2.5 seconds.
  • Chrome DevTools Lighthouse. Run a mobile performance audit. Look for “Properly size images,” “Serve images in next-gen formats,” and “Efficiently encode images.”
  • WebPageTest.org. Test from a mobile device on 4G. The filmstrip view shows exactly when your product image becomes visible.

A quick command-line check during development:

npx lighthouse https://your-store.myshopify.com/products/example \
  --only-categories=performance \
  --output=json \
  --quiet | jq '.categories.performance.score'

Aim for a performance score above 90 on mobile. Most unoptimized Shopify stores score between 30 and 60, so there’s usually a lot of room to improve.

Run these audits before and after your changes. Then revisit monthly. New products, theme updates, and app installs can quietly regress performance.

Shopify Image Optimization Checklist

Work through this step by step:

  1. Audit current image sizes. Open your top 5 product pages in Chrome DevTools, check the Network tab for image file sizes and dimensions.
  2. Standardize dimensions. Resize all product images to 2048 x 2048 px before upload.
  3. Compress originals. Use Squoosh or an automated tool to bring JPEG quality to 80-85%.
  4. Upgrade your theme’s Liquid tags. Replace img_url with image_url and image_tag to enable automatic WebP and native lazy loading.
  5. Enable lazy loading. Add loading: 'lazy' to all images below the fold. Use loading: 'eager' with fetchpriority: 'high' on the main product image.
  6. Consider an image CDN for automatic AVIF, smarter compression, and real-time resizing without re-uploading.
  7. Add 360 views to hero products. Start with your top 10 sellers and measure the conversion impact.
  8. Run Lighthouse monthly. Image optimization is not a one-and-done task.

What to Do Next

Shopify gives you a solid foundation, but there’s a big gap between “works fine” and “fully optimized.” The stores that close that gap load faster, rank higher, and convert more visitors into buyers.

Start with the fundamentals: proper dimensions, modern Liquid tags for WebP, responsive srcset, and lazy loading below the fold. Then add 360 product spins and deep zoom for your most important products. If managing all this manually feels like too much overhead, an image CDN like Sirv can automate the whole pipeline so you can focus on actually running your store.

Ready to optimize your images?

Sirv automatically optimizes, resizes, and converts your images. Try it free.

Start Free Trial