Skip to content

Image Optimisation

Images are usually the heaviest thing on a product page. Image Optimisation shrinks them: it generates modern WebP/AVIF versions of your catalogue images (typically 25–40% smaller), lazy-loads below-the-fold images while leaving your hero/LCP image eager, and tracks every conversion with its size saving — so pages get lighter and Core Web Vitals improve, with nothing to do per image.

Manage Images dashboard

Install Image Optimisation with Composer using your AgenticEcom licence key (find it on your My Licences page — one key unlocks every module you own):

Terminal window
# 1. Register the AgenticEcom repository (once per store)
composer config repositories.agenticecom composer https://repo.agenticecom.net
composer config --global --auth http-basic.repo.agenticecom.net <YOUR-LICENCE-KEY> x
# 2. Require this module
composer require agenticecom/module-image-optimisation
# 3. Apply it
php bin/magento setup:upgrade && php bin/magento setup:di:compile && php bin/magento cache:flush

Magento

Open Source 2.4.9 GA (and later 2.4.x).

PHP

Tested on 8.4 and 8.5.

Engine

Imagick when available, GD fallback.

Formats

WebP / AVIF, generated on demand or by cron.

Generates WebP/AVIF copies of catalogue images at a quality you set. The smaller format is served to browsers that support it, falling back to the original elsewhere — typically a 25–40% byte reduction with no visible quality loss.

  1. On demand — the first time an image is requested, its WebP/AVIF version is generated and cached (then served from cache thereafter).

  2. In bulkScan All Product Images finds everything that isn’t optimised yet, and Optimize Pending Images (or the cron) processes the backlog. The same two steps are available on the CLI: bin/magento agenticecom:image:scan then bin/magento agenticecom:image:optimize --pending-only (optionally --batch-size=200).

  3. The result is logged with its size saving, and the dashboard shows your running total.

For the initial backfill on an existing catalogue (or scripted/CI runs), use the CLI — it does exactly what the Scan All / Optimize Pending dashboard buttons do:

Terminal window
# 1. Register every existing product image for tracking (marks them "pending")
bin/magento agenticecom:image:scan
# 2. Generate WebP + AVIF siblings for the pending images
bin/magento agenticecom:image:optimize --pending-only
# Big catalogue? Cap each run (default 0 = all):
bin/magento agenticecom:image:optimize --pending-only --batch-size=200
# (Re)generate for ALL product images, ignoring the pending list:
bin/magento agenticecom:image:optimize
CommandWhat it does
agenticecom:image:scanScans existing product images and registers them as pending. Run this once after install; new uploads are tracked automatically.
agenticecom:image:optimize --pending-onlyGenerates WebP and AVIF for the pending images (respects the Enabled toggles + quality in config).
--batch-size=NProcesses only N per run — handy to spread a large backfill across cron ticks.
agenticecom:image:optimizeWithout --pending-only, regenerates for the whole catalogue.
Will lazy loading hurt my hero image / LCP?

No. The first N images on a page (your above-the-fold hero) are left eager — only below-the-fold images get loading="lazy". You can also exclude images by CSS class, so a slider or banner you want loaded immediately stays eager.

Do I have to convert every image manually?

No — images are converted on first request and cached, and you can bulk-process the whole catalogue with Scan + Optimize Pending (or let the cron do it). The dashboard tracks what’s done and what’s pending.

What if my server doesn’t have ImageMagick?

It falls back to PHP’s GD extension for WebP generation. Imagick is preferred (cleaner output, no libpng warnings) but isn’t required.

Is it safe to point it at user-supplied images?

Yes — every source is type- and size-validated before decoding (real JPEG/PNG/GIF, capped bytes, dimensions and pixel count), which blocks decompression-bomb attacks, and Imagick runs with hard resource limits. Verified clean on PHP 8.4 and 8.5.