Optimize Website Images Before You Upload
A practical workflow for web images: resize to the display slot, choose a format, compress from the master, set dimensions, and test the live page.
Updated: November 6, 2026
Quick answer: Resize each image to the largest width your layout shows, export WebP or JPEG at quality 75-85, keep heroes under roughly 200 KB, set width and height on every image, lazy-load below-the-fold images, and test the published URL on a phone.
Most slow landing pages are not slow because of bloated JavaScript frameworks. They stall because somebody dragged a 6 MB raw camera photo straight into a CMS media library for an 800-pixel blog slot.
Fixing that does not require complex automated build pipelines or expensive enterprise image CDNs. The real leverage happens at export time, right before the file leaves your local workstation.
Why images dominate Core Web Vitals and LCP
Images consistently make up nearly half of the total payload on modern websites. When Google measures Largest Contentful Paint (LCP), the target element is almost always a top-of-page hero banner or product photograph.
Three levers determine total file weight:
- Pixel dimensions (width and height).
- Compression codec (PNG vs WebP vs AVIF).
- Quality setting (quantization level).
A 4000×3000 camera shot contains 12 million pixels. Resizing that same picture to 1600×1200 leaves 1.92 million pixels — shedding 84% of the raw data before any compression even touches it. If you skip resizing and only drag a quality slider, you are trying to squeeze twelve million pixels through a cellular straw.
Recommended image byte budgets for modern websites
To pass Core Web Vitals on standard 4G connections (1.6 Mbps throughput), web pages should allocate explicit byte budgets per component slot.
| Page Slot | Layout Display Slot | Recommended Export Size | Target Format | Max Byte Budget | Impact on LCP |
|---|---|---|---|---|---|
| E-commerce Hero Banner | 1200-1440px wide | 1920×1080px (2x Retina) | WebP or AVIF | 120 - 180 KB | Direct LCP element; keep < 1.8s |
| Product Catalog Gallery | 300-400px cards | 800×800px square | WebP | 40 - 75 KB | Critical for smooth catalog scrolling |
| SaaS Landing Screenshot | 800-1000px column | 1600×1000px (Lossless) | WebP (Lossless) / PNG | 150 - 250 KB | Prevents text fuzziness in UI callouts |
| Editorial Inline Photo | 680-800px article body | 1400×933px landscape | WebP (Quality 78) | 70 - 110 KB | Lazy-load below fold; no LCP impact |
| Logo & Brand Marks | 150-240px wide | Scalable vector | SVG | 5 - 25 KB | Instant render; zero layout shift |
Format migration: real-world bandwidth comparison
Switching legacy formats (JPEG and PNG) to modern WebP or AVIF yields predictable bandwidth savings without noticeable degradation at normal viewing distances.
| Test Asset Description | Dimensions | Legacy Format (Size) | Modern WebP (Quality 80) | Savings (%) | Visual Fidelity at 100% Zoom |
|---|---|---|---|---|---|
| Outdoor Hero Photo | 1920×1080 | JPEG: 1,240 KB | WebP: 182 KB | 85.3% reduction | Indistinguishable from source JPEG |
| Software Dashboard UI | 1600×900 | 24-bit PNG: 2,150 KB | Lossless WebP: 340 KB | 84.2% reduction | Razor-sharp text, perfect UI borders |
| Apparel Product Shot | 1200×1200 | JPEG: 680 KB | WebP: 115 KB | 83.1% reduction | Clean fabric textures, no color banding |
| Marketing Badge (Alpha) | 600×600 | 32-bit PNG: 480 KB | WebP with Alpha: 82 KB | 82.9% reduction | Clean transparency edges without halos |
Five-step image optimization workflow
- Resize to the target container. Determine the maximum physical width your layout requires on desktop screens, then multiply by 1.5x or 2x for high-DPI displays. Never upload 4000px masters for an 800px column.
- Select the right format for the content. Photos belong in WebP or JPEG. UI captures with fine text belong in lossless WebP or indexed PNG. Logos and icons should remain SVG.
- Compress using local browser tools. Process your files locally with LessMB Image Compressor. Because processing runs in your browser sandbox, your unpublished product photos and client materials are never uploaded to a third-party server.
- Set explicit width and height attributes in HTML. Always define
widthandheightattributes on<img>tags. This reserves aspect-ratio space in the browser layout before bytes download, preventing layout shifts (CLS). - Add native lazy-loading for below-the-fold media. Apply
loading="lazy"to secondary cards and footer media. Crucially, never apply lazy loading to your hero image, as doing so delays your LCP metric.
If you are preparing MP4 hero loops or product clips alongside website graphics, run them locally through our video compressor, follow our CRF bitrate guide on how to compress MP4 video online without losing quality or how to compress video to 8MB, 10MB, or 25MB, and bundle deployment assets with the file compressor.
FAQ
What size should web images be?
Match the slot, not the camera. Most blog columns render at 680-800px, so a 1600px export covers sharp screens. Full-width heroes rarely need more than 1600-1920px.
Is quality 75 too low for photos?
Usually no. At display size, quality 75-85 looks identical for most photos. Inspect faces, text, and gradients at 100% zoom and raise quality only where you can see the difference.
Do I still need JPEG?
Mostly as a fallback. WebP works in every current browser and saves 25-35% at similar quality. Keep JPEG for platforms and email clients that reject WebP.
How much smaller will my page get?
Resize first. A 4000px photo resized to 800px loses about 96% of its pixels. Format and quality settings then cut the remainder by another 30-50%.
Related guides
Try it now — 100% in your browser
No upload, no sign-up, no watermark. Your files never leave your device.