How-to · 2026-12-01
Image optimization pipeline: a step-by-step that follows how practitioners actually do it
A working pipeline has four stages. Capture: product photography delivered at the largest size the store will ever display, in a consistent aspect ratio, so the CDN has something to work with. Processing: Shopify's CDN resizes and serves modern formats automatically when the theme requests sized images properly, which means the theme's image tags, not manual compression, are where quality is won or lost. Delivery: responsive srcset so a phone downloads a phone-sized file. Loading: everything below the fold lazy, the LCP image never lazy, with dimensions reserved so CLS stays at zero.
Step one: fix the source and the theme's requests
Upload the largest clean source you have, up to Shopify's image limits, and stop pre-compressing uploads by hand; the CDN generates the derivatives, and a hand-crushed source caps every derivative's quality forever. Keep aspect ratios consistent across a product's images so galleries do not jump and the layout can reserve one box for all of them.
Then audit the theme's image markup. The pipeline breaks where a template hardcodes a full-size image into a thumbnail slot, or where an app injects its own unoptimised gallery. The request size in the markup is the size the customer downloads; everything else is commentary.
Step two: responsive delivery and formats
Every image should ship with a srcset spanning the sizes it is actually displayed at, so the browser picks the smallest sufficient file. A 2048-pixel hero served to a 390-pixel phone screen is the single most common image weight failure on stores, and it is a markup fix, not a photography problem.
Format handling is mostly the platform's job: Shopify's CDN serves WebP where browsers support it. Your job is the exceptions: PNGs used for photographs, which balloon file size for no visible gain, and screenshots or graphics with text saved as JPEGs, which smear. Match format to content type at upload and the CDN does the rest.
Step three: loading discipline
Lazy-load below the fold, eagerly load the LCP image, and preload it on templates where it defines the page. The failure mode to hunt is the performance tool that lazy-loads everything including the hero, buying a lab metric by delaying the one image the customer is waiting for.
Reserve dimensions on every image so late loads shift nothing, and re-check after app installs: review widgets and recommendation rails inject images without your theme's discipline. The pipeline is only as good as its worst injector, so the audit list includes every app that puts a picture on a product page.
Related reading
For the background behind “Image optimization pipeline: a step-by-step that follows how practitioners actually do it”, these earlier guides help: Box-Free Label-Free Returns: What the QR Code Drop-Off Changes in Your Cost Stack, Grade A, B, C Is a Price List in Disguise: Grading Returns for Resale, and Box-Free Label-Free Returns: What the QR Code Drop-Off Changes in Your Cost Stack.
Frequently asked questions
Should I compress images before uploading to Shopify?
No. Upload the largest clean source and let Shopify's CDN generate sized derivatives and modern formats. Hand-compressed sources cap the quality of every derivative the CDN produces.
What is the most common image weight problem?
Oversized delivery: a full-resolution image served to a small phone screen because the markup lacks a proper srcset. Fix the image tags so browsers receive the smallest sufficient size.
Which images should be lazy-loaded?
Everything below the fold. Never the LCP image, usually the product hero or collection banner, which should load eagerly and be preloaded. Lazy-loading the hero is a common way performance tools quietly hurt real load times.
Why do image dimensions matter for CLS?
Without reserved width and height, images load into zero space and push content when they arrive, which is layout shift. Dimensions let the browser reserve the box, keeping CLS at or near zero.