How-to · 2026-12-01
Image optimization pipeline: a step-by-step that follows how practitioners actually do it
An image optimization pipeline is the set of steps every product and collection image passes through before and as it is served: right-sized derivatives, modern formats, responsive markup with reserved dimensions, and priority loading for the one image that is the page's largest contentful paint. Practitioners build it in that order, because the hero image decides the LCP score and everything else is refinement.
Step one: find the LCP image on each template
On the homepage, the top collections and the top products, identify which image is the largest contentful paint. Field tooling and a throttled lab run will both point at it: usually the hero or the first product image. Until that image is named, optimization effort is spread across hundreds of files that do not decide the score.
Check for hero video at the same time. It is the usual LCP killer on collection pages: even with a poster, the video stack loads early, competes for bandwidth and keeps the main thread busy. Many stores' fastest available win is a still hero with the video moved below the fold.
Step two: build the derivative and format rules
Define the sizes each template actually displays and make the pipeline produce exactly those: the CDN generates derivatives from the master when the theme requests widths through Shopify's image filters, and it serves modern formats where the browser supports them. The rule for uploads is a master large enough for the largest derivative and no larger; a 6000-pixel master for a 900-pixel slot is bandwidth taxed on every visit.
Compression is a judgment with a floor: apparel texture and color are the product, so test quality settings on fabric close-ups, not on graphics. A pipeline that saves 40 kilobytes by making knitwear look flat has optimized the wrong thing.
Step three: fix the markup and the loading order
Every image ships with dimensions or an aspect-ratio box, so the layout is still while images load; that is the CLS half of the pipeline. srcset and sizes let phones download phone-sized files. The LCP image gets priority, eager loading and a preload decision; every image below the fold gets lazy loading so it stops competing with the hero.
Then close the loop on process: uploads go through the pipeline, never around it. The step most teams skip is this governance step, and its cost appears as the one unoptimized campaign image that lands on the highest-traffic page in the biggest week of the year.
Related reading
Readers working through “Image optimization pipeline: a step-by-step that follows how practitioners actually do it” often find these earlier guides useful as well: Event Weekend Abuse: Tighten the Condition Check, Not the Whole Window, Decoy Returns: Inspect Before the Refund, Not After, and Bracketing vs Wardrobing: One Is Shopping, One Is Fraud.
Frequently asked questions
What does an image pipeline actually consist of?
Four steps: right-sized derivatives for each template's real display sizes, modern formats served by the CDN, responsive markup with reserved dimensions, and loading priority for the LCP image with lazy loading below the fold. In that order, because the hero image decides the score first.
Does Shopify optimize images automatically?
Largely, when the theme uses Shopify's image filters with widths: the CDN produces sized derivatives and serves modern formats like WebP to browsers that support them. What it cannot fix is oversized masters, missing dimensions in markup, or a hero video decision.
Why is the hero image so important?
It is usually the largest contentful paint, the element LCP times. At a 2.5-second threshold judged on real visits, the hero's size, format and loading priority decide whether the template passes. Optimizing thumbnails first is effort spent where the metric is not.
How do images cause layout shift?
Without reserved dimensions, the browser lays out the page before image sizes are known and reflows as each image lands. Width and height attributes or CSS aspect ratios reserve the space, which is why they are a pipeline requirement, not a nicety.