Shopify · May 28, 2023
How to Optimize Images on Shopify
Optimizing images on Shopify means shrinking file size without losing visible quality, serving the right dimensions per breakpoint, and letting the theme lazy-load anything below the fold. Get the source files right first — theme code can only build on what you upload.
By Polo Themes
Optimizing images on Shopify comes down to three things: upload correctly sized, compressed source files instead of raw camera exports; let Shopify's CDN handle responsive resizing instead of fighting it with oversized originals; and use a theme that lazy-loads offscreen images and doesn't request more resolution than the layout needs. Do the upload step right and most of the theme-level work becomes automatic. This guide walks through both halves in order.
Product photography is usually the heaviest asset type on a Shopify storefront, and it's also the easiest thing to get wrong without noticing — a slow store rarely looks slow to the merchant testing it on a fast office connection, but it feels slow to a shopper on mobile data scrolling a collection page. The good news is that image optimization on Shopify is mostly a checklist, not a deep technical project. None of the steps below require custom code.
Step 1: Start With the Right Source File
Every optimization step downstream depends on what you upload. If your source image is a 12-megapixel, uncompressed camera export, no amount of theme-level lazy-loading will make that page fast — the browser still has to download the full file before the CDN can resize it for later requests, and your admin dashboard fills up with multi-megabyte files that are slow to manage.
- Resize before upload. Product images rarely need to exceed 2048px on the longest side. Hero and banner images should match the largest size they'll actually render at, not the resolution your camera or design tool defaults to.
- Export as WebP where you can, JPEG otherwise. WebP typically produces meaningfully smaller files than JPEG at equivalent visual quality. Shopify accepts WebP uploads directly, and browsers that don't support it will fall back gracefully through Shopify's image CDN.
- Use JPEG for photos, PNG only for images that need transparency. PNG is a lossless format and produces far larger files for photographic content — reserve it for logos, icons, and images with transparent backgrounds.
- Compress before uploading, even after resizing. A dedicated image compressor (many run entirely in-browser) can often cut file size further with no visible difference, especially for JPEG and PNG exports straight out of design tools.
A simple habit that pays off over the life of a store: keep a consistent export pipeline (same resize dimensions, same export settings) so every product photo added later is already optimized on the way in, rather than needing a cleanup pass down the road.
Step 2: Let Shopify's CDN Do the Responsive Work
Shopify serves all uploaded images through its own image CDN, which can generate resized variants on the fly by request parameter — this is why you'll see image URLs in Shopify themes with a suffix like _1024x or a width parameter appended. You don't need an app for this part; it's built into the platform and into how properly built Shopify themes reference image assets in their templates.
The practical implication is that your theme's markup matters more than your upload settings once the source file itself is reasonably sized. A theme that requests full-resolution images for every thumbnail, or that doesn't use responsive srcset markup to serve smaller files to smaller screens, will waste bandwidth even with perfectly optimized source images. When evaluating a theme (ours or otherwise), check whether product grids and thumbnails visibly request smaller image variants than the full product-page gallery — that's a sign the theme is using the CDN's resizing correctly rather than serving one size everywhere.
Step 3: Confirm Lazy-Loading Is Actually Happening
Lazy-loading defers loading offscreen images until the shopper scrolls near them, which matters enormously on long collection pages and image-heavy homepages. Most modern Shopify themes lazy-load by default, but it's worth verifying rather than assuming — a theme that was heavily customized with third-party apps or legacy sections can quietly lose this behavior for some blocks.
- Open a collection page with 20+ products and check whether network requests for images near the bottom of the page fire immediately on load or only as you scroll toward them.
- Check homepage sections separately from product and collection templates — apps and custom sections sometimes bypass the theme's native lazy-loading.
- Confirm the very first, above-the-fold hero or featured image is not lazy-loaded — it should load immediately, since deferring the first visible image actually hurts perceived load speed.
This is one of the places where theme choice has a direct, measurable effect on store performance, and it's part of why we build lazy-loading and responsive image markup into our Shopify themes as a baseline rather than an optional setting — a merchant shouldn't need to know CDN parameter syntax to get a fast image pipeline out of the box. Our Shopify theme catalog is a reasonable place to compare how different themes handle this if you're theme-shopping specifically for performance.
Step 4: Write Alt Text While You're There
Alt text doesn't affect load speed, but it's worth doing during the same upload pass since you're already touching every image. Alt text helps accessibility (screen readers describe the image to visually impaired shoppers) and gives search engines context for image search results. Keep it specific and factual — describe what's actually in the frame ("navy wool overcoat, front view, buttoned") rather than stuffing it with keywords, which reads poorly to both assistive technology and search crawlers.
Step 5: Audit Periodically, Not Just at Launch
Image optimization tends to erode gradually as a catalog grows. A new team member uploads a batch of photos straight from a photographer without resizing; a seasonal banner gets swapped in at full camera resolution because it was needed quickly. A short recurring check catches this before it compounds:
- Spot-check file sizes in your Shopify admin's Files section every few months — anything well above a few hundred kilobytes for a standard product photo is worth a second look.
- Re-run new hero or banner images through the same resize-and-compress pipeline you use for product photos, since these are often uploaded by a different person or workflow (marketing vs. merchandising) and skip the usual process.
- If page speed feels like it's degraded over time with no code changes, check image weight before anything else — it's the most common quiet regression on stores with an active catalog.
Where Theme Choice Fits Into This
Everything above is something a merchant can do regardless of theme, but the theme still sets the ceiling. A theme with well-structured, semantic image markup and sensible lazy-loading defaults lets your optimized source files actually deliver a fast page; a theme that requests oversized images everywhere or lacks lazy-loading undoes some of that upload-side work no matter how carefully you compressed each file. If you're evaluating themes for a niche store — eyewear, for example — our Optics Shopify theme applies this same image-handling approach specifically to product galleries with multiple angle shots and zoom views, which is exactly the kind of image-heavy template where these defaults matter most. The general principle holds across categories: get the source files right, then pick a theme that doesn't waste that work.
Frequently Asked Questions
Do I need an image compression app for Shopify?
Not necessarily. If you resize and compress images before uploading, you're doing the bulk of the work an app would otherwise do after the fact. Compression apps are most useful for cleaning up an existing catalog of images that were uploaded uncompressed, rather than as an ongoing requirement.
What image format should I use for Shopify product photos?
WebP for the smallest file size at good visual quality, JPEG as a widely compatible fallback for photographic content, and PNG only when you specifically need a transparent background. Avoid PNG for standard product photography — the file sizes are unnecessarily large.
Will optimizing images actually improve my Shopify store's speed?
Images are typically the largest share of page weight on a visually driven storefront, so reducing their size usually produces a noticeable, direct improvement in load time — more so than most other single changes a merchant can make without developer help.
Does switching themes fix slow images automatically?
A well-built theme removes obstacles — proper lazy-loading, responsive image markup, no unnecessary full-resolution requests — but it can't compress an oversized source file for you. Optimize your uploads first; a good theme then lets that work actually pay off on the page.