Shopify already compresses images and converts formats for you, so most of your image optimization work is not compression. It is presentation: uploading good source files, sizing images correctly in your theme, loading the hero image first, lazy-loading the rest, and writing alt text that helps shoppers and search engines. This guide covers each of those, in the order that moves page speed most.
TL;DR
- Shopify’s CDN handles compression, WebP and AVIF conversion and responsive resizing. Upload the best source image you have and skip manual pre-compression.
- Never lazy-load the image in the first viewport. Shopify’s own performance guidance says to load it eagerly.
- Set width, height and aspect ratio through Liquid’s
image_tagandimage_urlso the layout does not jump. - Write short, specific alt text and descriptive filenames. It serves screen reader users and Google Images at once.
- Back up your theme before touching image code.
Table of Contents
- What Shopify already does for you
- Where image weight really hurts: LCP
- Responsive images and layout shift
- Back up your theme before you change anything
- Alt text and filenames: the part that is not automatic
- Image SEO beyond alt text
- Apps: when they help and when they hurt
- Our perspective
- A practical order of work
- Need it done properly?
- FAQ
- Sources
What Shopify already does for you
Many guides still tell you to run every photo through a compressor before upload. On Shopify, that advice is mostly out of date. According to the Shopify Help Center, the CDN performs compression, format conversion (including WebP and AVIF) and resizing, then serves each shopper an asset suited to their browser and device. Shopify’s own image optimization guide makes the same point: the platform does the heavy lifting.
That changes what you should do:
- Upload the highest quality source you have. Re-compressing an already compressed JPEG before upload can degrade quality, and the CDN will compress it again anyway.
- Do not hunt for a WebP converter. If you searched for how to use WebP on Shopify, the answer is that delivery in modern formats is automatic when the browser supports it.
- Spend your time on what the CDN cannot decide: which images load first, what dimensions the theme requests, and what the image means.
A caveat: that does not make every image free. A 6,000 pixel wide, 15 MB source is still a poor upload habit, and very large originals slow your admin and any workflow that touches them. Aim for a sensible maximum, such as a long edge in the range your largest display slot needs, and keep it consistent across the catalog.
Where image weight really hurts: LCP
The metric that image problems usually show up in is Largest Contentful Paint (LCP), the time until the biggest visible element renders. On a product page or homepage that element is usually an image. The business case is documented. A web.dev case study on Nuvemshop links a 68% improvement in LCP pass rate, achieved through image prioritization, to 8.9% more conversions. Swappie tied its Core Web Vitals work, which included preloading key images, lazy loading and proper sizing, to a 42% rise in mobile revenue. Those are other companies’ results, not a promise for your store, but the pattern is consistent: how images are prioritized matters more than how small the bytes are.
Do not lazy-load the hero
The most common self-inflicted wound is lazy-loading everything. Shopify’s theme performance recommendations state plainly that loading="lazy" on the LCP image delays it until layout completes, and that images visible in the initial viewport should load eagerly. The Nuvemshop study describes the same trap and points to fetchpriority="high" as the signal that tells the browser which image matters most.
In practice:
| Image position | Loading | Priority |
|---|---|---|
| Homepage hero, first product image on a product page | loading="eager" |
fetchpriority="high" |
| Second and third gallery images, collection grid below the first row | loading="lazy" |
Default |
| Footer, newsletter and review images | loading="lazy" |
Default |
If your theme has a section that can render in different positions (a banner that sometimes sits first, sometimes fourth), the theme code should decide eager or lazy by position, not by a hard-coded attribute. The Nuvemshop write-up makes this point about scale: the fix works when the theme applies sizing and priority automatically, rather than relying on someone remembering on every upload.
Lazy load everything below the fold
For the rest of the page, lazy loading is the right call. It keeps the initial payload small and defers off-screen images until the shopper scrolls near them. Most current Shopify themes do this already, so check before you add anything. Open your product page, view the page source and look at the loading attribute on the first three images.
Responsive images and layout shift
Shopify’s Liquid filters are the backbone of responsive delivery. The image_url filter generates a URL at a requested width, and the image_tag filter outputs a complete img element, which can include srcset and sizes so the browser picks the right file. Using them correctly does two things: it stops phones from downloading desktop-sized files, and it reserves space in the layout so the page does not shift as pictures arrive (cumulative layout shift, or CLS).
Checklist for a theme developer or a technically confident merchant:
- Output width and height on every image, or set an explicit aspect ratio in CSS.
-
Provide a
sizesattribute that matches how wide the image actually renders at each breakpoint. Asizesvalue that claims 100vw for a four-column grid makes browsers fetch files far larger than needed. -
Request a sensible width range in
srcset, not a single huge width. - Keep aspect ratios consistent across product photos. Mixed ratios cause cropping surprises and jumpy grids. Shopify’s media settings and the crop and resize tools in the admin help here.
- Test on a real mid-range phone over a throttled connection, not only on your office laptop.
Be careful with custom theme edits. Before you change any of the code above, duplicate the live theme.
Back up your theme before you change anything
Image fixes live in theme files, and a wrong edit can break your product pages. The Shopify Help Center recommends making a backup copy before you customize a theme, so you can discard changes and start again. Go to Online Store, open the actions menu on the theme and choose Duplicate. Two details from the same page are worth knowing: a store can hold 20 themes, so you may need to delete an old one first, and a downloaded theme file does not include your products, collections, pages, blog posts or the images stored under Content, Files.
So a theme duplicate protects your code, not your catalog. For products and images, export your product CSV and keep your original high resolution photos in your own storage. Treat the Shopify CDN as a delivery layer, not as your only archive.
Alt text and filenames: the part that is not automatic
No CDN can write alt text for you, and this is where image work pays twice: accessibility and search.
What good alt text looks like
Shopify’s alt text documentation says alt text is read by assistive technology to describe an image to a visually impaired customer, and recommends keeping it brief, with 125 characters or fewer, though the limit is 512. Google’s image SEO guidance asks for descriptive, context-rich alt text, warns against keyword stuffing, and prefers filenames like black-leather-boots.jpg over IMG001.JPG.
| Weak | Better |
|---|---|
shoes |
Black leather ankle boots with a stacked heel, side view |
best cheap boots buy boots online boots sale |
Woman wearing black leather ankle boots with blue jeans |
| (empty, on an informative product photo) | Close-up of the boot’s stitched welt and rubber sole |
Decorative images, such as a purely visual divider, can have empty alt text so screen readers skip them. Informative images should not.
Doing it for a large catalog
Typing alt text product by product works for 40 SKUs. It does not for 4,000. Shopify lets you upload alt text in a CSV file, and developers can update media programmatically through the Admin GraphQL API; the older productUpdateMedia mutation is marked deprecated in favor of fileUpdate. A sound approach is to generate a draft from product data (title, color, angle), review a sample by hand, then apply it in bulk. Automated drafts need a human check, because a generated sentence that is wrong is worse than a short accurate one.

The other half is fixing the template, not just the data. If your theme outputs images without an alt attribute at all in some sections, no amount of catalog editing will fix it. This write-up on fixing missing image alt text at the template level explains why crawling for the pattern and fixing the source beats patching pages one by one.
Accessibility is also a legal exposure
Missing alt text is one of the issues that shows up in accessibility complaints against online stores. If your brand sells in the US, treat image accessibility as part of compliance, not just polish. A one-off audit, followed by fixes in the theme, is the sensible order. We cover this in our Shopify Accessibility (ADA) and data privacy service. For any actual legal question about your exposure, talk to an attorney who handles digital accessibility.
Image SEO beyond alt text
Images can bring traffic through Google Images, but only if Google can find them. From Google’s documentation:
- Use standard HTML
imgelements so images are discoverable. - Place images near relevant text on the page.
- Use descriptive filenames. Rename before upload; Shopify keeps the uploaded filename in the URL.
- Make sure the image’s landing page is itself indexable and has a clear title and content.
Image work is one input to a wider technical SEO picture, along with collection structure, internal linking and structured data. If you want to see how it fits together, our Shopify SEO services page lays out what we cover, and our Shopify conversion optimization playbook shows how speed work connects to revenue.
Apps: when they help and when they hurt
Image optimization apps are heavily marketed. Because the CDN already compresses and converts, an app that re-compresses your files is often duplicating work. Apps can still earn a place for specific jobs: bulk alt text drafting, or scanning a catalog for oversized originals. The costs are real, though. Every app can add scripts, and scripts affect load time. Before installing one, ask:
- What does it do that the CDN does not?
- Does it inject JavaScript on the storefront, or work only in the admin?
- What happens to your images if you uninstall it?
- Can you measure the before and after on LCP, not just on a file size report?
The same discipline applies to the rest of your app stack. If you are unsure what to keep, our Best Shopify Apps Selection and Setup service is built for that audit.
Our perspective
We see the same pattern with DTC brands that come to us with a slow store: they have already compressed every photo twice, and the store is still slow. The images were not too heavy. The theme asked for the wrong size, lazy-loaded the hero, or sat behind a stack of apps loading scripts before the first picture could paint.

Our view is that image optimization on Shopify should be a theme rule, not a habit. If a merchant has to remember a checklist on every product upload, the process will fail by the 200th product. The theme should decide eager or lazy, set the dimensions, and fall back to sensible alt text. People should only supply what only people can: good photos and an honest description of what is in them.
We also push brands to measure. Pick your three highest traffic templates, record LCP and CLS before any change, change one thing at a time, and compare. That is how a fixed-scope project stays honest: you know what you bought and whether it worked.
— Jason
A practical order of work
If you have one afternoon, do this:
- Duplicate your live theme.
- Measure your homepage, a top collection and a top product page in PageSpeed Insights, and note LCP, CLS and which element is the LCP.
- Fix the LCP image: eager, high priority, correctly sized.
-
Check
sizesand dimensions on collection grids. - Audit alt text: find empty or stuffed values on your best sellers first.
- Rename files going forward with a simple convention, such as brand, product, color and angle.
- Remeasure and keep a record.
Need it done properly?
If your store is slow and you do not want to experiment on live revenue pages, our Shopify Speed Optimization engagement covers this kind of work for a fixed fee of 1999 USD, one-off. For image accessibility and privacy compliance, the Shopify Accessibility & Data Privacy engagement is 999 USD, one-off. You can see everything we offer for store technology in our ecommerce technology collection.
FAQ
Do I need to compress images before uploading them to Shopify?
Generally no. Shopify’s CDN compresses images and converts formats such as WebP and AVIF automatically, according to the Shopify Help Center. Upload the best quality source you have at a reasonable size, and spend your effort on theme sizing and loading behavior instead.
Should I lazy load all my Shopify images?
No. Lazy load images below the fold, but load the first-viewport image, usually your hero or main product photo, eagerly with a high fetch priority. Shopify’s performance guidance warns that lazy-loading the LCP image delays it.
How long should alt text be on Shopify?
Shopify allows up to 512 characters but recommends 125 or fewer. Describe what is in the image and its role on the page, and avoid stuffing keywords. Google’s guidance says the same about stuffing.
Does duplicating a theme back up my product images?
No. A duplicate or downloaded theme does not include products, collections, pages, blog posts or files stored under Content, Files, per the Shopify Help Center. Keep your original photos in your own storage and export your product data separately.
Sources
- Uploading images, Shopify Help Center
- Image optimization guide, Shopify
- Performance best practices for Shopify themes, Shopify.dev
- Adding alt text to media, Shopify Help Center
- Duplicating themes, Shopify Help Center
- productUpdateMedia mutation, Shopify.dev
- Image SEO Best Practices, Google Search Central
- Nuvemshop image prioritization case study, web.dev
- Swappie Core Web Vitals case study, web.dev
