Compress Images to a Target File Size for Email and Web
Many real-world constraints are expressed in file size, not pixels: email attachment limits, CMS upload caps, page speed budgets, marketplace listing rules. Guessing quality settings until the file fits is tedious — so this guide covers the strategy, and how PPPP does the iterating for you.
Why file size matters more than you think
Every extra 100 KB of hero image costs measurable load time on mobile connections, and page speed directly affects both search rankings and conversion rates. Google has used page experience as a ranking signal for years, and the largest image on a page is usually the biggest factor in its Largest Contentful Paint score.
On the email side, providers silently reject or mangle oversized attachments, and many corporate inboxes still enforce limits in the 5–10 MB range. A 4000×3000 photo straight from a camera is typically 8–15 MB — far beyond what's sensible for a web page or an inbox.
Resize before you compress
The most common compression mistake is shrinking quality when you should be shrinking dimensions. A 4000-pixel-wide photo squeezed to 40% quality looks worse and weighs more than the same photo resized to its actual 1200-pixel display size at 85% quality.
Always ask: how many pixels will this image actually occupy? Then resize to (at most) twice that for high-DPI screens, and only then tune quality. Dimensions are free visual quality; compression artifacts are not.
- Hero/banner images: resize to display width, aim for under 200 KB
- Inline content images: aim for under 100 KB
- Email attachments: keep total message size under 5 MB
- Thumbnails and avatars: under 30 KB is realistic and worthwhile
Fit to a target size automatically
Sometimes the requirement is absolute: a market research platform caps uploads at 1 MB, a job application portal at 2 MB, a government form at 500 KB. In PPPP's export dialog, choose 'Fit to target size', enter your budget, and the editor automatically searches for the highest quality setting that stays under the limit.
You still control the format and dimensions — the quality slider is the variable that gets solved for you. The live preview shows exactly what the result will look like before you download, so there are no surprises.
Format choice multiplies your efforts
Compression strategy and format choice work together. For web photos, switching from JPEG to WebP buys you roughly a third of your size budget back at identical visual quality — often enough to skip a quality reduction entirely. For graphics with transparency, WebP's lossy-with-alpha mode can be a tenth the size of an equivalent PNG.
The one format to avoid for size-sensitive work is PNG-for-photographs: it has no quality dial to turn, so your only lever is reducing dimensions.
Quick checklist for web images
Before publishing any image to a website, run through this sequence:
- Resize to the display dimensions (no point shipping 4000px to a 1200px slot).
- Pick WebP for photos, PNG for graphics with text or transparency.
- Aim for under 200 KB for heroes, under 100 KB for inline images.
- Preview the compressed result at 100% zoom — artifacts hide at fit-to-screen sizes.
- Keep a lossless master so you can re-export when requirements change.
Try it yourself
Open the editor and apply what you just read — free, no sign-up, and your images never leave your device.
Open the editorKeep reading
How to Edit Images Without Uploading Them Anywhere
Why browser-based editing is the safest way to work with private photos, and how PPPP keeps every pixel on your device.
GuidesPNG, JPEG or WebP? Choosing the Right Export Format
A practical guide to picking the right image format for social posts, websites and archives — with quality and size trade-offs explained.