Images are the heaviest assets on your Shopify store. They're also the most neglected.
We've audited stores where a single hero banner was 4.8MB. Collection pages loading 40 unoptimized product images at full resolution. Product pages with 8 variant images, none of them sized for the viewport they're actually displayed in.
The result: slow pages, poor Core Web Vitals, lower Google rankings, and conversion rates that suffer silently because nobody connects "the site feels slow" to "the images are 10x larger than they need to be."
Here's the complete technical guide to getting Shopify images right — from file naming to responsive rendering.
What Shopify's CDN Already Does for You
Before you do anything, understand what Shopify handles automatically. This is where most guides get it wrong — they tell you to convert to WebP or set up a CDN when Shopify already does both.
Shopify serves all images through Fastly's CDN, one of the fastest content delivery networks in the world. Every image uploaded to Shopify is automatically:
- Served via CDN edge nodes closest to the user's location
- Converted to WebP format when the browser supports it (since 2021)
- Available in multiple sizes through Shopify's image URL API
- Cached with appropriate headers for repeat visits
This means you do not need a separate image CDN, you do not need to manually convert images to WebP, and you do not need a third-party image optimization app for basic format conversion.
What Shopify does not do automatically: resize images to the correct dimensions for your layout, add proper alt text, implement responsive srcset attributes, or lazy load images on older themes.
File Naming for SEO
This is the easiest win and the most consistently ignored.
When you upload a product image called IMG_4321.jpg, Shopify uses that filename in the image URL. Google's image search uses filenames as a ranking signal. You're leaving traffic on the table.
Bad: IMG_4321.jpg, product-photo.png, screenshot-2025-12-01.jpg
Good: blue-cotton-v-neck-tshirt-front.jpg, organic-face-serum-30ml-bottle.jpg, handmade-leather-wallet-brown-open.jpg
The formula: [colour]-[material]-[product-name]-[variant]-[angle].jpg
Rename your files before uploading to Shopify. Once uploaded, the filename is permanent — you can't change it without re-uploading.
For bulk renaming, use a tool like Adobe Bridge, XnConvert, or a simple script:
# Rename all images in a folder with a product prefix
for f in *.jpg; do
mv "$f" "organic-face-serum-${f}"
done
Alt Text Strategy
Alt text serves two purposes: accessibility (screen readers describe the image to visually impaired users) and SEO (Google uses alt text to understand image content and rank it in image search).
Shopify gives you two places to set alt text:
- Product images: Admin → Products → Edit product → Click image → Add alt text
- Theme images: In the theme editor, most image sections have an alt text field
Writing good alt text:
- Describe what the image actually shows: "Woman wearing blue cotton v-neck t-shirt, front view" not "T-shirt"
- Include your target keyword naturally, not forcefully
- Keep it under 125 characters (screen readers may truncate longer text)
- Don't start with "Image of" or "Photo of" — the screen reader already announces it's an image
- For decorative images (backgrounds, separators), use empty alt:
alt=""
For programmatic fallbacks on collection pages:
{% assign alt = image.alt | default: product.title | append: ' - ' | append: product.vendor %}
<img src="{{ image | image_url: width: 400 }}" alt="{{ alt | escape }}">
This creates structured alt text like "Premium Cotton Tee - BrandName" when no manual alt text exists. Not ideal, but significantly better than an empty alt attribute.
Alt text overlaps directly with accessibility compliance — it's required by WCAG 2.1 AA and it helps your SEO. Two wins from one effort.
Responsive Images with Shopify's Liquid Filters
This is where the real performance gains happen.
Most Shopify themes load a single image size for every viewport. A 1200px product image served to a 375px mobile screen wastes bandwidth and destroys your Largest Contentful Paint (LCP) score.
Shopify's image_url filter lets you request specific widths:
{{ product.featured_image | image_url: width: 600 }}
But the real power is in srcset, which lets the browser choose the right size:
<img
src="{{ image | image_url: width: 600 }}"
srcset="
{{ image | image_url: width: 375 }} 375w,
{{ image | image_url: width: 600 }} 600w,
{{ image | image_url: width: 800 }} 800w,
{{ image | image_url: width: 1200 }} 1200w
"
sizes="(max-width: 600px) 100vw, (max-width: 1024px) 50vw, 33vw"
alt="{{ image.alt | escape }}"
loading="lazy"
width="{{ image.width }}"
height="{{ image.height }}"
>
Key points:
- The
sizesattribute tells the browser how wide the image will be displayed at each breakpoint - Always include
widthandheightattributes to prevent layout shift (CLS) - Shopify's CDN handles the actual resizing — you're just telling it what sizes to generate
For hero banners and above-the-fold images, don't use loading="lazy" — these need to load immediately. Use fetchpriority="high" instead:
<img
src="{{ section.settings.hero_image | image_url: width: 1400 }}"
srcset="
{{ section.settings.hero_image | image_url: width: 750 }} 750w,
{{ section.settings.hero_image | image_url: width: 1100 }} 1100w,
{{ section.settings.hero_image | image_url: width: 1400 }} 1400w,
{{ section.settings.hero_image | image_url: width: 1800 }} 1800w
"
sizes="100vw"
alt="{{ section.settings.hero_image.alt | escape }}"
fetchpriority="high"
width="{{ section.settings.hero_image.width }}"
height="{{ section.settings.hero_image.height }}"
>
Lazy Loading on Collection Pages
Collection pages are where lazy loading makes the biggest difference. A collection with 24 products and 2 images each means 48 images loading on page load. With lazy loading, only the first 6-8 visible images load immediately.
Dawn and most modern Shopify themes include loading="lazy" by default. If your theme doesn't, add it to your collection product card template:
{% for product in collection.products %}
<img
src="{{ product.featured_image | image_url: width: 400 }}"
alt="{{ product.featured_image.alt | default: product.title | escape }}"
loading="{% if forloop.index <= 4 %}eager{% else %}lazy{% endif %}"
width="{{ product.featured_image.width }}"
height="{{ product.featured_image.height }}"
>
{% endfor %}
The conditional loading attribute ensures the first 4 products load immediately (above the fold) while the rest lazy load as the user scrolls.
When to Use GIF vs. Video vs. WebP
Short answer: almost never use GIFs on a Shopify store.
GIFs are catastrophically large. A 3-second product animation as a GIF can easily be 5-10MB. The same animation as an MP4 video is typically 200-500KB — a 10-20x reduction.
For product animations, lifestyle loops, or hero banners with motion, use MP4 video with the <video> tag:
<video autoplay muted loop playsinline>
<source src="{{ section.settings.video_url }}" type="video/mp4">
</video>
For static images, Shopify's CDN automatically converts to WebP. For animated content that must be an image (not video), consider AVIF or animated WebP — but test browser support first.
Pre-Upload Optimization
Even though Shopify's CDN converts to WebP and serves optimized versions, starting with a smaller source file means faster processing and better quality.
Before uploading to Shopify:
- Resize to maximum display size: If your product image grid never exceeds 800px wide, don't upload a 4000px original. Upload at 1600px (2x for retina)
- Compress with Squoosh or ImageOptim: Target 80% JPEG quality — the difference between 80% and 100% is invisible to the human eye but the file size difference is massive
- Strip metadata: EXIF data (camera info, GPS coordinates, timestamps) adds unnecessary bytes. Squoosh strips this automatically
- Use JPEG for photographs, PNG only for graphics with transparency
Shopify's upload limit is 20MB per image. If you're anywhere near that limit, your image is far too large.
Real Performance Impact: The FloraSoul Case
When we worked with FloraSoul India, their mobile Largest Contentful Paint (LCP) was 4.2 seconds — well above Google's "good" threshold of 2.5 seconds.
After a full image audit and optimization:
- Mobile LCP dropped from 4.2s to 1.8s
- Total page weight on collection pages reduced by 62%
- Mobile conversion rate increased by 41%
The biggest single improvement: replacing a 3.2MB unoptimized hero banner with a properly sized, srcset-enabled responsive image. That one change alone cut 1.1 seconds off the LCP.
Image optimization wasn't the only factor in FloraSoul's conversion improvement, but it was the foundation. You can't optimise a funnel on a page that takes 4 seconds to paint.
The Shopify Image Optimization Checklist
- Rename files with descriptive, keyword-rich names before upload
- Write manual alt text for every product image
- Implement responsive
srcseton product and collection templates - Use
loading="lazy"for below-the-fold images,fetchpriority="high"for hero images - Pre-compress with Squoosh (80% JPEG quality, max 1600px for product images)
- Replace all GIFs with MP4 video
- Include
widthandheightattributes on every<img>tag to prevent CLS - Test with Lighthouse and PageSpeed Insights after changes
This isn't glamorous work. But it's the kind of work that compounds — every page gets faster, every product ranks better in image search, every mobile user has a smoother experience.
For a companion guide on the technical SEO setup that works alongside image optimization, see our Shopify sitemap and robots.txt guide.
If you want a full performance audit of your store, book a discovery call. At Innovatrix Infotech, performance isn't an afterthought — it's where we start.
Written by

Founder & CEO
Rishabh Sethia is the founder and CEO of Innovatrix Infotech, a Kolkata-based digital engineering agency. He leads a team that delivers web development, mobile apps, Shopify stores, and AI automation for startups and SMBs across India and beyond.
Connect on LinkedIn