X-Cart WEBP Image Generator

(Introduced June 25th 2021)

WEBP is a relatively new image format, created by Google, that provides superior compressed images.

X-Cart v4 Classic (and v5 for that matter) does not support the uploading of WEBP images, so we've come up a non-destructive method that enables you to quickly use WEBP images, without the need for manual image converting, and keeps your original JPEG/PNG images intact.

X-Cart v4 Classic WEBP Image Generator

For the WEBP generator to work seamlessly, it helps if you have 'clean' and relatively high-quality source JPEG/PNG images to begin with.

Unless you require transparency on images, you should be using JPEG images instead of PNGs. Note, the generator will not convert GIFs, although they will still be visible customer-side.

Always ensure your image filename extensions are lowercase, ie. my-image.jpg my-image.JPG

It converts your original JPEG/PNG images to WEBP format, and stores them in new folders. For example, it will convert your /images/T product thumbnail images to WEBP and store them in /images/webp/T

WEBP generation time depends on how many images you have, and their file size/dimensions. It also depends on how capable your server is.

You can generate all WEBP images in one pass, or if you encounter any issues, generate images individually, eg. only product thumbnails.

The 'Cleanup Image Folders' button will delete images from the /images/X folders, that don't exist in the database. This can purge redundant image files and save you some server space.

The 'Update All WEBP Images' button generates missing WEBP images... Click this button after you have added new products etc.

You can enable/disable the display of WEBP images customer-side anytime in the template settings > images

In our tests, you can usually save on average at least 60% in overall image file sizes, resulting in a faster-loading site.

As you can see from the real examples below, there's barely any reduction in WEBP image quality, yet the file sizes are dramatically lower...

JPEG - 1200x850 - 122k

JPEG - 1200x850 - 122k

WEBP - 1200x850 - 55k

WEBP - 1200x850 - 55k

JPEG - 2000x1298 - 483k

JPEG - 2000x1298 - 483k

WEBP - 2000x1298 - 253k

WEBP - 2000x1298 - 253k

Prior to running the WEBP generator for the first time, we recommend ensuring the setting "Image type for generated thumbnails" in Admin > General Settings > Appearance, is set to "jpeg" and perform a regeneration of the image cache in Admin > Tools > Maintenance.


On rare occasions, the WEBP generator may produce an error and halt, due to one or more bad images, in which case you should try and locate the image(s) and re-upload them.

Or, the image file extension could be invalid. We have added some new tools in /images that scan your image folders for invalid file extensions...

https://xcartmods.com/redux4712/images/!png_check.php.txt - Scans for JPEGs that are actually PNGs
https://xcartmods.com/redux4712/images/!jpg_check.php.txt - Scans for PNGs that are actually JPEGs

To use them, the /images/.htaccess file must include...

<Files "*.php*">
Allow from all
</Files>


The WEBP image format is supported by nearly all modern browsers (reBOOT no longer supports Internet Explorer).

Older versions of Safari do not support WEBP, but we may eventually add in a fallback for such users. In the meantime, you should encourage your visitors to use a more modern browser.

FYI, WEBP is NOT supported in your browser!

There's some useful WEBP tools/resources listed in the links page.

© 2013-2024 xcartmods.co.uk