Last updated 2026-11-18
Resize before you compress
The biggest saving usually comes from size, not compression. A photo straight from a modern phone can be several thousand pixels wide, far larger than the space it will occupy on a web page. Decide the largest width the image will be displayed at, then resize to that width, or to twice that width if you want sharp display on high-density screens. Compression then works on a sensible image instead of a huge one.
Keep the original file safe. Resize and compress a copy so you can return to the source if you need a different size later. This is a simple habit that prevents repeated quality loss when an image is edited several times.
Pick the right format
JPEG suits photographs with lots of colour and gradual shading. PNG suits graphics, screenshots and anything that needs transparency. WebP usually gives smaller files than both at similar quality and is supported by all modern browsers. For simple logos and icons, SVG is often the best choice because it stays sharp at any size and is usually very small.
When you convert between formats, avoid saving a JPEG as a PNG for the sake of quality. A PNG made from a JPEG keeps the compression artefacts but makes the file larger. Convert from the original source where possible.
Find the quality setting that works
Lossy formats let you trade quality for size. Start at around 75 to 85 percent quality for photographs and compare the result at 100 percent zoom, looking at skin tones, text edges and gradients. Stop reducing quality as soon as artefacts become visible. For graphics with flat colour, PNG optimisation tools can cut size without changing how the image looks.
Finally, check the page after the change. Load it on a phone and a laptop, and confirm that important images remain clear. Add descriptive alt text so the image still communicates its purpose for screen readers and search engines.