
Image Optimisation for Magento 2 — WebP, AVIF & Lazy Loading
Image Optimisation converts your Magento 2 product and CMS images to WebP and next-gen AVIF, compresses and resizes oversized uploads, generates retina variants, and lazy-loads off-screen images — so pages load faster, your Core Web Vitals improve, and shoppers see sharp images on every device.…
Heavy images are the quiet tax on your conversion rate
Product photography is the first thing a shopper notices and one of the last things most stores optimise. Un-compressed JPGs and PNGs slow your pages, drag down your Core Web Vitals, and cost you mobile shoppers on slow connections — and Google has measured page experience as a ranking signal since 2021. Image Optimisation fixes this at the source: it converts your catalogue to WebP and next-gen AVIF, compresses and resizes oversized uploads, generates retina variants, and lazy-loads off-screen images — without you re-exporting a single photo.
loading="lazy" on off-screen images.What you'll use it for
- Pass Core Web Vitals — smaller, modern image formats cut Largest Contentful Paint, the metric most often failed on product and category pages.
- Win mobile shoppers — lighter pages load faster on phones and slow connections, where a large share of buying happens.
- Modernise an existing catalogue — scan and convert every image already on disk, not just new uploads, in one command-line pass.
- Tame bloated uploads — automatically downscale 5,000-pixel hero shots to a sensible maximum and strip embedded metadata.
How it works
When the conversion runs — your choice
You decide how images are generated, so the work never blocks a shopper's page render:
Generate on first request, asynchronously to protect time-to-first-byte, in the background on cron, or entirely from the command line. For an existing store, agenticecom:image:scan registers every product image, and agenticecom:image:optimize converts them — with a --pending-only mode and a --batch-size so you can work through a large library in controlled passes.
Built to be safe on real catalogues
It won't fall over on a bad file. Before decoding anything, the converter rejects sources over 30 MB, images beyond 12,000 px on a side, or more than ~50 megapixels — guarding your server against decompression-bomb uploads and runaway memory. ImageMagick runs under explicit memory, area and time limits. Failures are logged, not fatal, and PNG/GIF transparency is preserved.
More than just format conversion
| Formats | WebP and AVIF generated next to your originals (AVIF needs AVIF-capable ImageMagick/GD) |
|---|---|
| Compression | Quality 1–100 (default 80); metadata stripped for smaller files |
| Resize | Auto-downscale uploads over your maximum width/height (default 2048×2048) |
| Retina | Optional @2x double-resolution variants for HiDPI displays |
| Lazy loading | Native loading="lazy"; exclude the first N above-the-fold images and any CSS classes you name |
| Delivery | Optional tags for older browsers; optional WebP swap in GraphQL responses and CSS backgrounds |
| Scope | Catalogue images, plus optional CMS / WYSIWYG images (pages, blocks, blog); skip-folders list supported |
| Reporting | Admin dashboard logging original vs optimised size and compression % per image |
| Delivery & licence | Composer install, per-domain licence key, updates via Composer |
Works with
Part of the AgenticEcom suite for SEO & Content:
Included in the Growth and Enterprise bundles.
Frequently asked questions
Does this convert images I've already uploaded, or only new ones?
Both. New uploads are handled automatically, and for an existing catalogue you run agenticecom:image:scan to register every image, then agenticecom:image:optimize to convert them in batches.
What's the difference between WebP and AVIF, and do I need both?
Both are modern formats that are much smaller than JPG or PNG. AVIF is typically up to 30% smaller again than WebP but needs an AVIF-capable image library on your server. You can enable WebP, AVIF, or both; a tag keeps older browsers on a format they support.
Will image conversion slow down my store?
No — you choose when it runs. Generate asynchronously on page load, in the background on cron, or entirely from the command line, so the heavy work never blocks a shopper's page.
Does it keep PNG transparency?
Yes. Transparency in PNG and GIF sources is preserved through conversion, and image metadata is stripped to reduce file size.
Which Magento and PHP versions are supported?
Magento Open Source 2.4.9 and later 2.4.x, verified on PHP 8.4 and 8.5, with no third-party dependencies.

