Why image size matters
Images are usually the heaviest part of a web page. A single unoptimised photo can weigh more than all of the HTML, CSS and JavaScript combined. Smaller images load faster, use less mobile data and make the whole experience feel lighter.
The goal is not simply the smallest file. It is the smallest file that still looks right at the size it will be displayed.
Start with dimensions, not quality
The most effective compression is resizing. A 4000px photo shown in a 800px card is wasting pixels. Resize it to roughly twice the display width for high-density screens, then compress.
Use the Image Resizer to set a maximum width, or the Image Compressor if you only need to reduce weight.
Choose the right format
- JPEG is still excellent for photographs.
- WebP usually beats JPEG at the same visual quality and supports transparency.
- PNG is best for screenshots, logos and images with sharp edges or transparency.
- AVIF can be smaller still, but support and encoding speed vary.
For most photos, WebP at 70–85% quality is the sweet spot. For screenshots, keep PNG and reduce the number of colours if needed.
Quality is not a file-size percentage
A quality setting controls how much detail the encoder keeps. Lower quality allows stronger compression, so the percentage saved goes up — but the image also gets softer. Quality 100% is close to lossless and may barely shrink a PNG.
Start at 80%, compare the result, and only go lower if the image still looks clean.
A simple workflow
- Resize to the largest size you actually need.
- Pick WebP for photos or PNG for graphics.
- Set quality around 80%.
- Compare the before and after.
- Download and check the file on a real page.
Avoid common mistakes
Do not compress the same image repeatedly — each pass loses a little quality. Keep the original and generate the web version from it. Do not use a huge image and rely on CSS to shrink it; the browser still downloads every pixel.
Finally, use descriptive filenames and alt text. A fast image is useful; a fast, accessible image is better.