How to compress images for a faster website

5 August 2026 · 5 min read

On a typical page, images account for more bytes than the HTML, CSS and JavaScript combined. Because page speed affects both how visitors behave and how search engines rank you, image handling is usually the highest value optimisation available.

Decision one: the format

Decision two: the quality setting

For JPG and WebP, 80 percent is the sweet spot. It is visually indistinguishable from the original for almost everyone and typically halves the file. 60 percent is fine for thumbnails and background images. Below 50 percent you start seeing blocking around edges and text.

Do not save a JPG repeatedly at high quality thinking you are being safe. Every save re-encodes and loses a little. Keep an original and export from it.

Decision three: the dimensions

This is the one most people skip and it matters more than the quality slider. A 4000 pixel wide photo displayed in an 800 pixel wide column wastes 96 percent of its pixels. Resize to roughly twice the display width to look sharp on high density screens, and no more. That single change often cuts a page in half.

Compress JPG images

A workable process

  1. Resize to at most twice the width the image will be displayed at.
  2. Convert to WebP for the web, keeping a JPG or PNG copy as a fallback if you support very old clients.
  3. Export at 80 percent quality and check the result at full size once.
  4. Batch the rest at the same settings and download them together.

Batch conversion here downloads everything as a single ZIP, and files you already downloaded are excluded from the next ZIP so you do not get duplicates.

Convert images to WebP