June 22, 2026 · 10 min read
How to Compress Images for Shopify Without Losing Product Detail
Shopify merchants get told two contradictory things. On one side: "Shopify's CDN handles image optimization automatically, don't worry about it." On the other: "Your images are killing your conversion rate." Both are partly true, and the gap between them is where most stores lose money.
Here's the actual situation. Shopify's CDN resizes images and converts formats on the fly. It does not compress the file you uploaded. A 6 MB product photo stays 6 MB in your storage and gets served at full weight to every uncached visitor until you replace it. Meanwhile, your product photography is the product — customers can't touch it, so compressing away the fabric texture on a jacket costs you sales.
This guide covers how to get product images under 200 KB while keeping the detail that actually sells.
Table of Contents
- What Shopify Does and Doesn't Do for You
- Correct Dimensions for Every Shopify Surface
- File Size Targets by Image Role
- The Pre-Upload Compression Workflow
- Protecting Detail in Product Photography
- Using image_url and image_tag Properly
- Fixing Collection Pages: The Worst Offender
- Fixing Your LCP on Product Pages
- Frequently Asked Questions
1. What Shopify Does and Doesn't Do for You
| Task | Shopify handles it | You handle it |
|---|---|---|
| Serving WebP to supporting browsers | ✅ Automatic | — |
| Serving AVIF to supporting browsers | ✅ Automatic | — |
| Generating responsive size variants | ✅ Via URL parameters | Must request them |
| Resizing oversized uploads above 5000px | ✅ Automatic | — |
| Compressing your source file | ❌ Never | ✅ Before upload |
| Choosing correct dimensions | ❌ | ✅ |
| Lazy loading below-fold images | ❌ Theme-dependent | ✅ |
| Prioritizing the LCP image | ❌ | ✅ |
| Writing alt text | ❌ | ✅ |
The critical row is the bolded one. Shopify's CDN is a delivery layer, not an optimization layer. Format conversion helps — WebP is typically 25–35% smaller than JPEG — but 30% off a 6 MB file is still a 4 MB file.
There's also a gap the CDN can't cover at all: images loaded through custom HTML, CSS background images, app-injected content, and metafield images accessed without the image_url filter all bypass Shopify's transformation pipeline entirely. Those are served exactly as you uploaded them.
2. Correct Dimensions for Every Shopify Surface
Uploading bigger than you need doesn't improve quality — Shopify caps at 5000 × 5000 px and 20 MB anyway, and oversized sources slow down your admin and your first uncached load.
| Surface | Recommended dimensions | Aspect ratio |
|---|---|---|
| Product image | 2048 × 2048 px | 1:1 |
| Product image (apparel, vertical) | 1600 × 2000 px | 4:5 |
| Collection banner | 1920 × 1080 px | 16:9 |
| Homepage slideshow | 1920 × 1080 px | 16:9 |
| Collection thumbnail | 1024 × 1024 px | 1:1 |
| Blog featured image | 1600 × 900 px | 16:9 |
| Logo | 500 px wide (or SVG) | Variable |
| Favicon | 96 × 96 px | 1:1 |
2048 px on product images is deliberate: it's the standard threshold for Shopify's zoom functionality on most themes, and it gives the CDN enough source pixels to generate every smaller variant cleanly. Going to 4000 px does not improve zoom quality on a screen — it just doubles your storage and your first-load cost.
3. File Size Targets by Image Role
| Image role | Target | Hard ceiling |
|---|---|---|
| Product image (2048px) | 150–250 KB | 400 KB |
| Homepage hero / slideshow | 150–200 KB | 300 KB |
| Collection thumbnail | 30–60 KB | 100 KB |
| Blog featured image | 80–120 KB | 200 KB |
| Logo (raster) | Under 20 KB | 40 KB |
| Total collection page weight | Under 1.5 MB | 2.5 MB |
That last row deserves attention. A collection page showing 48 products with unoptimized thumbnails can easily push 10 MB — and collection pages are frequently the highest-traffic template on the store after the homepage.
4. The Pre-Upload Compression Workflow
How to prepare a batch of product photos
- Export from your editor at the target dimensions, not at camera resolution. 2048 × 2048 for square product shots.
- Convert HEIC first if you shoot on iPhone. Shopify won't accept HEIC uploads, and the default iOS format catches merchants out constantly.
- Choose your format. WebP is the safe default — Shopify accepts it directly and it's 25–35% smaller than JPEG at matched quality. Keep PNG only for logos and anything needing transparency.
- Compress at quality 82–88 for product images. This is higher than the general web default of 80–85, deliberately — see the next section on protecting detail.
- Compress in the browser, in bulk. A client-side tool like CompressFile.pro processes a batch without uploading anything, which matters when you're handling a full product shoot and don't want to wait on a server queue or hand unreleased product photography to a third party.
- Rename descriptively before upload.
merino-crew-neck-charcoal-front.webpbeatsDSC_0847.webp. Shopify uses the filename in the image URL, and it's a small but free Google Images signal. - Upload, then set alt text in the admin for every image. Describe the product as you'd describe it to someone on the phone.
5. Protecting Detail in Product Photography
General web advice says quality 80. For product photography, that advice is slightly wrong — and knowing why lets you compress harder where it's safe.
Lossy compression degrades high-frequency detail first: fine texture, thread patterns, hair, grain, subtle surface finish. These are exactly the attributes that reduce returns and drive purchase confidence. Meanwhile it barely touches flat areas — a white studio backdrop compresses almost for free.
| Product type | Recommended quality | Why |
|---|---|---|
| Textiles, knitwear, upholstery | 85–90 | Weave detail is the buying signal |
| Jewellery, watches | 88–92 | Fine engraving and reflection detail |
| Electronics, hard goods | 80–85 | Mostly flat surfaces, compresses well |
| Cosmetics, packaging | 80–85 | Flat colour and type |
| Food | 85–88 | Texture drives appetite appeal |
| Lifestyle / model shots | 80–85 | Detail is contextual, not diagnostic |
| Collection thumbnails (any) | 70–78 | Rendered small; detail invisible |
How to test whether you've gone too far
- Compress one representative image at three quality levels — say 75, 85, and 92.
- View all three at the size customers actually see them, not zoomed to 100%. Most detail panic comes from inspecting images at magnifications no customer will use.
- Then check the zoom view. If your theme offers pinch-zoom on product images, evaluate at that magnification too — this is where compression artifacts genuinely matter.
- Look specifically at gradients and shadows. Banding in a soft studio shadow is the earliest visible artifact.
- Pick the lowest quality where you see no difference, and use it as your standard for that product category.
Different categories can carry different settings. That's not overcomplicating it — a knitwear shot and a phone case shot have genuinely different requirements.
6. Using image_url and image_tag Properly
If you or your developer touch Liquid, this is the highest-leverage change available.
The default behaviour without a width parameter returns the source dimensions — meaning a 2048px file gets sent to a 400px mobile viewport. Multiply by 24 product cards and the waste is enormous.
{{ product.featured_image | image_url: width: 800 | image_tag:
loading: 'lazy',
widths: '400, 600, 800, 1200',
alt: product.featured_image.alt,
class: 'product-card__image' }}
How to apply it
- Always pass a
width. This alone fixes the single most common Shopify LCP failure. - Use
image_tagwith awidthslist rather than a singleimage_url— it generates a completesrcsetin one call so the browser picks the right size per device. - Leave format to auto. Shopify negotiates AVIF/WebP/JPEG from the browser's
Acceptheader. Forcing a format overrides that and usually costs you savings. - Set
loading: 'lazy'on everything below the fold — and explicitly not on the main product image. - Check CSS background images separately. They bypass the pipeline; either move them to
<img>elements or hard-code CDN URLs with width parameters.
Shopify caches CDN derivatives permanently, so setting width once optimizes every subsequent request at no ongoing cost.
7. Fixing Collection Pages: The Worst Offender
Collection pages combine every image mistake at once: many images, all loaded simultaneously, usually at full source dimensions.
How to fix a heavy collection page
- Count the images. Open DevTools → Network → filter Img, load a collection page, and read the total transfer size.
- Reduce products per page from 48 to 24 if your theme allows, with pagination or infinite scroll.
- Add
widthto every card image viaimage_tagas above. Thumbnails rendered at 300px do not need 2048px sources. - Lazy-load everything below the first row. The first four to six cards should load eagerly; everything after that gets
loading="lazy". - Drop thumbnail quality to 70–78. At 300px render size this is invisible and roughly halves the weight.
- Skip the hover-swap second image on mobile, or lazy-load it separately. Many themes preload two images per card by default.
8. Fixing Your LCP on Product Pages
On a product page, the LCP element is almost always the main product image. Three rules:
- Never lazy-load it. This is the most common single cause of failing LCP on Shopify themes.
- Add
fetchpriority="high"so it's fetched ahead of scripts and stylesheets competing for bandwidth. - Preload it in
theme.liquidwhen on a product template:
{% if template.name == 'product' %}
<link rel="preload" as="image"
href="{{ product.featured_image | image_url: width: 1200 }}">
{% endif %}
Then confirm in PageSpeed Insights that the LCP element's render delay has dropped. On stores I'd expect a 300–800 ms improvement on mobile from these three changes alone.
9. Frequently Asked Questions
Does Shopify compress my images automatically? No. It converts format and resizes on request, but the original file you upload is stored and served at its uploaded weight. Compression is your job.
Should I upload WebP or JPEG? WebP. Shopify accepts it, it's smaller at matched quality, and you keep control over the compression rather than relying on CDN conversion that may not fire in every context.
Will compression hurt my product photography? Not at quality 85–90, which is what this guide recommends for detail-critical categories. The visible-damage threshold is well below that. Test one image at three settings before committing to a standard.
Do I need a Shopify image optimization app? If you have thousands of legacy product images, an app saves real time on the bulk pass. For ongoing uploads, browser-side compression before upload is faster, free, and doesn't add another script to your storefront.
What about the 20 MB / 5000 px limits? They're outer boundaries, not targets. Nothing on your store should approach either. Uploading at 2048 px and under 250 KB is the practical standard.
The Short Version
- Shopify converts formats and resizes — it never compresses your source file.
- Upload product images at 2048 × 2048 px, under 250 KB, in WebP.
- Use quality 85–90 for textiles, jewellery, and food; 80–85 for hard goods; 70–78 for thumbnails.
- Always pass a
widthtoimage_url, and useimage_tagwith awidthslist for automaticsrcset. - Never lazy-load the main product image — give it
fetchpriority="high"and preload it.
Batch-compress a full product shoot in seconds — in your browser, with nothing uploaded anywhere.