You export a photo for a blog post, upload it, and the page suddenly takes four seconds to load. You open the file and it is 4.2 MB. The image looks good, but it was never optimised for the web in the first place.
This is the most common performance problem a small site has, and it is usually fixable in a couple of minutes without touching the visual quality. The trick is understanding the order of operations: format, then dimensions, then quality. Get that order wrong and you either lose detail or waste time compressing pixels nobody will ever see.
What compression is actually doing
There are two kinds, and they behave very differently.
- Lossless compression shrinks the file without changing any pixel values. PNG works this way. The savings are modest, but nothing degrades.
- Lossy compression throws away detail the eye is less likely to notice. JPG and WebP work this way. The savings can be huge, but push it too far and you get blocky patches around text and edges.
For most web images, lossy compression at a sensible setting is the right answer. Reserve lossless PNG for text, logos, screenshots, and anything that needs transparency.
Step one: pick the format
| What the image is | Use | Why |
|---|---|---|
| Photos and complex scenes | JPG or WebP | Small files with good quality at 75 to 85 percent |
| Logos, icons, text | PNG or SVG | Sharp edges, no compression blocks |
| Screenshots containing text | PNG | JPG turns small text fuzzy |
| Anything with transparency | PNG or WebP | JPG has no alpha channel |
| Modern browsers, smallest file | WebP | Often 25 to 35 percent smaller than JPG at similar quality |
If you are unsure, export both a JPG and a WebP and compare. The smaller file that still looks clean wins. There is no prize for using the more modern format if it looks worse.
Step two: resize before you compress
This is the step most people skip, and it has the biggest effect. Compression cannot bring back detail, but resizing removes pixels you never needed in the first place.
A 4000 px wide photo displayed in a 1200 px column is wasting bandwidth even after aggressive compression. The browser still has to decode all those extra pixels.
- Decide the largest size the image will actually be displayed at.
- Resize to that width, or double it if you need sharpness on high-density screens.
- Only then compress.
Use the Image Resizer for the resize step and the Image Compressor for the quality step. Both run in your browser, so the files never leave your device.
Step three: choose a quality level that fits the job
| Where the image goes | JPG quality | Notes |
|---|---|---|
| Web hero image | 78 to 85 percent | Balance sharpness against weight |
| Blog inline photo | 75 to 82 percent | Usually indistinguishable from the original |
| Instagram upload | 85 to 90 percent | The platform re-compresses again |
| Product photo | 85 to 92 percent | Detail matters because people zoom in |
| Email image | 70 to 78 percent | Keeps the whole email light |
For WebP, start around 75 to 85 percent. It usually looks better than JPG at the same file size, so you can often go a little lower without noticing.
Why PNG sometimes gets bigger
PNG is lossless, so "compressing" a PNG mostly reorganises data rather than discarding it. A busy photo saved as PNG can end up much larger than the JPG it came from. If you compress a PNG and the file grows, the content is almost certainly photographic. Switch to JPG or WebP instead of fighting the format.
Target sizes that keep pages fast
| Placement | Target size |
|---|---|
| Full-width web hero | 150 to 350 KB |
| Blog inline image | 60 to 150 KB |
| Thumbnail or card image | 30 to 80 KB |
| Email image | Under 100 KB |
| Instagram post | Under 1 MB |
These are guidelines, not rules. A detailed product photo may legitimately need more, and a flat illustration may need far less. What matters is that the file is proportional to its role on the page.
The Instagram case
Instagram re-compresses every upload, and it is stricter on large files. To keep more control over the result:
- Export at the final dimensions, for example 1080 x 1350 for portrait or 1080 x 1080 for square.
- Save as JPG at 85 to 90 percent, or WebP if your editor supports it.
- Keep the file under about 1 MB. Smaller uploads tend to survive with less visible damage.
- Do not over-sharpen before upload. Instagram's compression can exaggerate halos and make edges look crunchy.
How to judge the result
Do not judge compression by file size alone. Open both versions at 100 percent zoom and look at three things:
- Edges around text and high-contrast lines.
- Smooth gradients such as skies, skin, and backgrounds.
- Fine texture like hair, fabric, and foliage.
If you cannot see a difference at 100 percent, the smaller file is the right choice. If you can see blocking in a gradient but the file is still large, the problem is probably the dimensions, not the quality slider.
Mistakes worth avoiding
- Compressing before resizing. Resize first, then compress. The order matters.
- Saving photos as PNG. It is lossless but often several times larger than necessary.
- Calling 30 to 50 percent "optimised". That is not optimisation, it is visible damage.
- Re-saving the same JPG. Every save adds artifacts, so start from the master each time.
- Ignoring display size. Uploading a 6000 px image into a 600 px slot is wasted bandwidth no matter how well it is compressed.
A few minutes of resizing and one sensible quality setting will usually cut an image's weight by most of its original size with no visible loss. For a small site, that is one of the highest-return changes you can make, and it costs nothing but a little attention. Need to switch formats too? Use the Image Format Converter or read our WebP vs. JPG vs. PNG guide.
Sources
- web.dev: Choose the right image format - Core Web Vitals and format selection guidance.
- Google Developers: WebP Compression Study - WebP vs. JPEG and PNG file-size benchmarks.
- Instagram Help Center: Photo Resolution - official 1080 px upload width guidelines.