PluginsAppsPricingConsultingAboutBlog (opens andrewbaker.ninja in a new tab)Help Get in touch
👁15views

← CloudScale Plugin Help/CloudScale Cleanup, Free WordPress Database Cleaner, Image Optimizer & Cron Manager

Image Optimisation

CloudScale Cleanup, Free WordPress Database Cleaner, Image Optimizer & Cron Manager, Image Optimisation screenshot
On a phone
CloudScale Cleanup, Free WordPress Database Cleaner, Image Optimizer & Cron Manager, Image Optimisation screenshot, as it appears on a mobile screen
The same panel at 390px, showing how it reflows. Cropped to the first screens.

The Image Optimisation tab reduces the on-disk file size of images already in your media library using PHP’s GD or Imagick library. No external service, API key, or data transfer is involved, all processing runs locally on your server.

How it works

The optimiser processes original uploaded images in two passes:

  1. Resize, any image whose width or height exceeds the configured maximum is scaled down proportionally. The aspect ratio is preserved. Smaller images are left untouched. Resizing applies in both lossy and lossless mode.
  2. Recompress, either lossy (the default: JPEGs are re-saved at the configured quality level) or lossless (PNGs are re-saved at maximum compression with every pixel unchanged, and JPEG compression is never touched). Optionally, JPEGs and PNGs are converted to WebP, or non-transparent PNGs to JPEG.

Thumbnails are regenerated only when an image is resized or converted to another format. A quality-only recompression leaves the existing thumbnails in place, which keeps those runs fast.

Processing runs at 1 image per AJAX request, so each request finishes in seconds on any host. The JavaScript engine queues all images and fires requests in sequence until the queue is empty, showing a live progress bar and per-image savings in the console. Each result is written to a new or temporary file first and only replaces the original if the saving clears the minimum gain threshold, so an interrupted request never leaves a broken image.

Always run Dry Run first. The dry run lists every image that would be processed, with the reason (oversized, recompressible, WebP, lossless PNG, PNG→JPEG) and an estimated saving, without modifying any files.

Important: this operation modifies original image files on disk. Take a full backup of your wp-content/uploads directory before running on a production site. WordPress 5.3+ automatically preserves a -scaled backup copy of very large originals, but this is not a full backup.

Optimisation Settings

  • Maximum width (px), any image wider than this value is scaled down proportionally. The height is recalculated to preserve aspect ratio. Default: 1920 px. If your theme never displays images wider than 1200 px, setting this to 1200 will produce better storage savings.
  • Maximum height (px), any image taller than this value is scaled down. Default: 1080 px.
  • JPEG quality (1 to 100), controls compression when saving JPEG and lossy WebP. 80 to 85 is the recommended range for web photography. Default: 82. Below 70 introduces visible banding in gradients. Above 90 produces diminishing returns with disproportionately larger file sizes. Not used for lossless saves.
  • Min. file size (KB), images smaller than this are skipped. Default: 100 KB.
  • Min. gain threshold (%), if the optimised file is not at least this much smaller, it is discarded and the original kept. Default: 10%.
  • Convert JPEGs and PNGs to WebP, converts originals to WebP at the quality setting, keeping transparency, regenerates thumbnails as WebP, and repoints image links in post content (full size and every thumbnail size) to the new files. Typical saving: 25 to 35% on a JPEG, 50 to 80% on a PNG. Greyed out when the server’s image library cannot write WebP. Off by default.
  • Convert non-transparent PNGs to JPEG, PNG files without transparency are converted to JPEG; PNGs with an alpha channel or a transparent colour are detected and left alone. Typical size reduction for photographic PNGs: 40 to 70%. Attachment metadata and post content links are updated so existing references keep working. Ignored while WebP conversion or lossless mode is on.
  • Lossless mode (no quality loss), nothing is re-encoded at a lower quality. PNGs are re-saved at maximum zlib compression with metadata stripped and the colour profile kept, typically 5 to 20% smaller with pixel-identical output. With WebP conversion on, PNGs become lossless WebP instead, typically 20 to 30% smaller than the PNG. JPEGs are only touched if they need resizing (a JPEG converted to lossless WebP would come out larger), and PNG→JPEG is off. Uses Imagick when available; on GD-only servers, 16-bit and colour-profiled PNGs are skipped because GD cannot re-save them unchanged. Off by default.

Server requirements

  • PHP 7.4+ with GD compiled with JPEG and PNG support, or the Imagick extension. WebP conversion needs WebP support in either; lossless WebP on GD needs PHP 8.1+. Imagick is preferred for lossless mode.
  • Check with: php -m | grep -i "gd|imagick"
  • Minimum recommended memory_limit: 128 MB for standard images; 256 MB for images larger than 5000 × 5000 px.
  • No external network access required.
← Back to all sections