Updated
1. Choose the format for the content
- Photos and detailed art: WebP. The file is smaller than a JPG at about the same quality. All current browsers can show it.
- Screenshots, app screens and graphics with sharp edges or text: PNG, or lossless WebP. Lossy compression throws away detail, and it blurs fine edges.
- Logos and icons: SVG. It stays sharp at any size and is often just a few kilobytes.
- JPG is still the safe pick when the image must work outside a browser. Think of email, print or old apps.
2. Resize before you compress
The quality slider is rarely the biggest saving. Say a photo is 4000 pixels wide but shows in an 800 pixel column. It holds about 25 times more pixels than the page can show. Export it at about twice the largest size it is shown at, and no bigger. The extra covers sharp, high-density screens.
3. Lower the quality until you can see it, then step back
For lossy formats, try a quality of about 75 to 85 percent. Most photos lose a big part of their file size there with no change you can see. Compare the result with the original at the size it will be shown, not zoomed in.
Each round of lossy compression loses a bit more. Always start from the first, full-size file. Never start from a copy you already shrank.
Why PNGs barely shrink
PNG is lossless, so a quality slider has little to work with. Is the PNG big because it holds a photo? Then change the format instead of pushing harder. A WebP keeps the see-through parts and is usually much smaller.
Clean up SVG exports
SVGs saved from design apps carry notes, editor data and extra spaces. The browser needs none of it. Taking it out loses nothing. It also makes the file easier to paste into your HTML.
What it does for performance
On most pages, the biggest thing on the first screen is an image. Google times how fast it shows up. This is called Largest Contentful Paint, one of the Core Web Vitals. So lighter images help that score right away. Also set width and height on each image, so the layout does not jump as images load. And lazy-load images below the first screen, so they load only when the reader scrolls down.