E-COMMERCE6 MIN READ

How to Prepare Product Images for Zoom vs Thumbnails

Published

Preparing product images for zoom vs thumbnails comes down to treating them as two different jobs: thumbnails need to be small and fast so grids and search results load quickly, while zoom images need enough resolution to show fabric texture, stitching, or print detail when a shopper magnifies them. The practical fix is to generate several sizes from one master image and let the browser pick the right one with srcset, rather than forcing every visitor to download a large zoom-ready file just to see a small listing thumbnail.

Why should you use different sizes for thumbnails and zoom?

A product listing page might show 20 to 60 thumbnails at once, while a product detail page usually shows one zoom image at a time. If you serve the same large file for both, the listing page loads dozens of oversized images the shopper never properly views, which slows the page and hurts metrics like Largest Contentful Paint. If you serve a thumbnail-sized file everywhere, zoom becomes blurry because there isn't enough pixel data to magnify.

The solution is a small set of derived sizes from one source image: a thumbnail for grids, a medium size for the main product image at normal zoom level, and a larger file reserved for the zoom/lightbox interaction. Each size is only loaded when it's actually needed.

What are the recommended dimensions for product images?

There's no single dimension that fits every store, since it depends on your grid layout and how zoom is triggered. The table below is a practical starting point you should adjust to your own theme's layout widths, illustrative rather than a fixed rule.

Use caseTypical display sizeSuggested source sizeNotes
Grid thumbnail150-300px wide400-600px wideCovers standard and higher-density screens without over-serving
Main product image400-800px wide800-1200px wideShown before any zoom interaction
Zoom / lightboxFills most of viewport1600-2400px wideOnly loaded when zoom is triggered

Keep in mind that pixel dimensions, not DPI metadata, determine how an image displays on screen. Exporting a file at a higher DPI value without increasing its pixel width does nothing for zoom quality.

How to implement zoom without slowing down your page

The main risk with zoom features is loading the large zoom image before it's needed, or loading it as a hidden element that still counts toward page weight. A cleaner pattern is to load the medium-size main image first, then fetch the larger zoom image only when the shopper hovers, clicks, or opens a lightbox.

Worked example: a simple zoom trigger (illustrative)

Say a product page shows a main image at 800px wide. On hover, a script swaps the image source to a 2000px wide version and applies CSS transform to magnify the cursor area. The 2000px file is only requested at the moment of hover, not on initial page load. This keeps the first paint light while still giving shoppers a detailed zoom when they ask for it. This is a description of a common pattern, not a measured benchmark from our own testing.

If the main product image is the LCP element of the page, make sure it is not lazy-loaded. Lazy-loading the LCP image delays it instead of helping.

How to use srcset to serve the right image size automatically

Rather than hardcoding one file per use case in your templates, srcset lets you list multiple sizes of the same image and have the browser choose. Using the srcset attribute allows you to provide multiple versions of an image, letting the browser choose the best one based on the device's viewport width.

For this to work correctly, you also need the sizes attribute, since the browser uses it to determine the intended display size of an image, allowing it to select the most appropriate source from the srcset list. Without a sizes value that matches your actual layout, the browser may guess wrong and pick a larger or smaller file than needed.

Worked example: thumbnail srcset (illustrative)

A grid thumbnail might use an img tag with srcset listing a 300w, 450w, and 600w version of the same photo, plus a sizes value of something like 25vw on desktop and 50vw on mobile. The browser then picks whichever file matches the thumbnail's actual rendered width on that device, rather than always downloading the largest option.

What file size targets should you aim for?

There's no universal byte target that applies to every store, since it depends on your page's total image count and your performance budget. A practical approach is to set a budget per role: thumbnails should be the lightest files on the page since many load at once, the main product image is a mid-weight single file, and the zoom image can be heavier because it only loads on demand.

JPEG remains lossy even at high quality settings, so a thumbnail compressed aggressively will show visible softening if you ever try to reuse it as a zoom source, don't downsample and recompress the same file for both roles. Generate thumbnails and zoom images separately from the original master, not from each other, to avoid compounding quality loss.

How to check the result

  • →Open the product page in your browser's dev tools network panel and confirm the thumbnail grid is loading small files, not full zoom-size images
  • →Zoom into the product detail image and check for visible blur or pixelation at the magnification level your theme supports
  • →Confirm the zoom-size file only downloads after the zoom interaction, not on initial page load
  • →Check that swapped-in zoom images don't shift surrounding layout, since reserved space prevents layout shift, not just smaller file sizes

A few limitations worth knowing: re-encoding a raster image for a smaller thumbnail strips most embedded metadata, which is usually fine for product photos but worth confirming if you rely on embedded copyright or color profile data. Also, browser support for decoding and displaying a format doesn't guarantee your tools can encode into it, so test your actual export pipeline rather than assuming format support both ways.

As a next step, pick one product page, generate the three sizes from its master image, wire up srcset and sizes, and check the network panel to confirm each image role is loading the file you expect rather than a one-size-fits-all export.

Ready to optimize your images?

TRY ZIPMYIMAGES FREE →

Related guides