CompressFile.pro
CompressFile.pro
← Back to Blog

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

  1. What Shopify Does and Doesn't Do for You
  2. Correct Dimensions for Every Shopify Surface
  3. File Size Targets by Image Role
  4. The Pre-Upload Compression Workflow
  5. Protecting Detail in Product Photography
  6. Using image_url and image_tag Properly
  7. Fixing Collection Pages: The Worst Offender
  8. Fixing Your LCP on Product Pages
  9. Frequently Asked Questions

1. What Shopify Does and Doesn't Do for You

TaskShopify handles itYou handle it
Serving WebP to supporting browsers✅ Automatic
Serving AVIF to supporting browsers✅ Automatic
Generating responsive size variants✅ Via URL parametersMust 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.

SurfaceRecommended dimensionsAspect ratio
Product image2048 × 2048 px1:1
Product image (apparel, vertical)1600 × 2000 px4:5
Collection banner1920 × 1080 px16:9
Homepage slideshow1920 × 1080 px16:9
Collection thumbnail1024 × 1024 px1:1
Blog featured image1600 × 900 px16:9
Logo500 px wide (or SVG)Variable
Favicon96 × 96 px1: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 roleTargetHard ceiling
Product image (2048px)150–250 KB400 KB
Homepage hero / slideshow150–200 KB300 KB
Collection thumbnail30–60 KB100 KB
Blog featured image80–120 KB200 KB
Logo (raster)Under 20 KB40 KB
Total collection page weightUnder 1.5 MB2.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

  1. Export from your editor at the target dimensions, not at camera resolution. 2048 × 2048 for square product shots.
  2. Convert HEIC first if you shoot on iPhone. Shopify won't accept HEIC uploads, and the default iOS format catches merchants out constantly.
  3. 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.
  4. 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.
  5. 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.
  6. Rename descriptively before upload. merino-crew-neck-charcoal-front.webp beats DSC_0847.webp. Shopify uses the filename in the image URL, and it's a small but free Google Images signal.
  7. 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 typeRecommended qualityWhy
Textiles, knitwear, upholstery85–90Weave detail is the buying signal
Jewellery, watches88–92Fine engraving and reflection detail
Electronics, hard goods80–85Mostly flat surfaces, compresses well
Cosmetics, packaging80–85Flat colour and type
Food85–88Texture drives appetite appeal
Lifestyle / model shots80–85Detail is contextual, not diagnostic
Collection thumbnails (any)70–78Rendered small; detail invisible

How to test whether you've gone too far

  1. Compress one representative image at three quality levels — say 75, 85, and 92.
  2. 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.
  3. 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.
  4. Look specifically at gradients and shadows. Banding in a soft studio shadow is the earliest visible artifact.
  5. 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

  1. Always pass a width. This alone fixes the single most common Shopify LCP failure.
  2. Use image_tag with a widths list rather than a single image_url — it generates a complete srcset in one call so the browser picks the right size per device.
  3. Leave format to auto. Shopify negotiates AVIF/WebP/JPEG from the browser's Accept header. Forcing a format overrides that and usually costs you savings.
  4. Set loading: 'lazy' on everything below the fold — and explicitly not on the main product image.
  5. 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

  1. Count the images. Open DevTools → Network → filter Img, load a collection page, and read the total transfer size.
  2. Reduce products per page from 48 to 24 if your theme allows, with pagination or infinite scroll.
  3. Add width to every card image via image_tag as above. Thumbnails rendered at 300px do not need 2048px sources.
  4. Lazy-load everything below the first row. The first four to six cards should load eagerly; everything after that gets loading="lazy".
  5. Drop thumbnail quality to 70–78. At 300px render size this is invisible and roughly halves the weight.
  6. 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:

  1. Never lazy-load it. This is the most common single cause of failing LCP on Shopify themes.
  2. Add fetchpriority="high" so it's fetched ahead of scripts and stylesheets competing for bandwidth.
  3. Preload it in theme.liquid when 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

  1. Shopify converts formats and resizes — it never compresses your source file.
  2. Upload product images at 2048 × 2048 px, under 250 KB, in WebP.
  3. Use quality 85–90 for textiles, jewellery, and food; 80–85 for hard goods; 70–78 for thumbnails.
  4. Always pass a width to image_url, and use image_tag with a widths list for automatic srcset.
  5. 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.