SquishPixel Blog · Guides

How to optimise product photos for an online store

Product photos have two jobs that pull in opposite directions. They have to be detailed enough to sell the product and light enough not to slow the page. Most stores get one of the two wrong. This is the routine for getting both.

1. Shoot and crop consistently

  • Use one aspect ratio for every product, so that grids line up. Square is the most common choice.
  • Keep the background the same across a range. White or a light neutral is standard, and marketplaces often require white.
  • Fill the frame. A product that takes up a small part of a large image wastes pixels and looks small in listings.

2. Export at a sensible size

You need enough pixels for zooming on a high-density screen and no more. About 2000 pixels on the longest side is plenty for most stores. Shopify, for example, suggests 2048 by 2048 pixels for square product images, and accepts files up to 5000 by 5000 pixels and under 20 MB.

Export in the sRGB colour space. Images saved in a wider colour space can look dull or oversaturated in software that ignores the embedded colour profile.

3. Find out what your platform does for you

This decides how much of the remaining work is yours.

  • Hosted platforms such as Shopify resize your upload into the sizes each page needs and send each browser a format it supports. Your job is a clean original at a sensible size. Uploading an enormous file brings no benefit.
  • Self-hosted stores such as WooCommerce create resized copies when you upload but, without a plugin or an image CDN, usually serve them in the format you uploaded. Compress and convert before you upload, or add a plugin that does it for you.

4. Choose the format and compress

  • Photos: JPEG or WebP. If you host the files yourself, WebP is smaller at the same quality.
  • Cut-outs that need a transparent background: WebP or PNG. SquishPixel's background remover makes the cut-out in your browser.

Compare each result with the original at full size before you publish. Fabric texture, fine print on packaging and the gradient of a studio backdrop are where too much compression shows first. Our guide to compressing without visible loss has the method.

5. Name and describe the files

  • File names. blue-linen-shirt-front.jpg tells a search engine more than IMG_4032.jpg.
  • Alt text. Describe the product as you would to someone who cannot see it: "Blue linen shirt, front view". Screen readers read it aloud, and image search uses it.

6. Load them well

If you control the page template:

  1. Set width and height on every image, so the layout does not shift as they load.
  2. Load the main product image first. Do not lazy-load it, and give it fetchpriority="high".
  3. Lazy-load the rest of the gallery, and anything below the fold, with loading="lazy".
  4. On category pages, serve small thumbnails with srcset. Do not send the full-size product image and let the browser scale it down.

The main product image is usually the largest thing on the page, so it sets the page's Largest Contentful Paint. Our guide to a faster LCP image goes further.

A checklist for each new product

  1. Same aspect ratio and background as the rest of the range.
  2. About 2000 pixels on the long side, in sRGB.
  3. Compressed, and checked against the original.
  4. A descriptive file name and alt text.
  5. The main image loads first, and gallery images load lazily.

Compress a batch before you upload

SquishPixel compresses a batch of product photos in your browser and hands them back as a single download. Nothing is uploaded, so photos of products you have not announced stay private.