How to compress images for websites
Image weight is the largest single factor in page load time, and page load time is the largest single factor in Core Web Vitals. This guide walks through the perceptual encoding workflow that keeps hero images, product photography, and marketing visuals crisp while dramatically reducing payload.
Why web image compression matters
Largest Contentful Paint - the hero metric in Core Web Vitals - is almost always an image. A 1.8MB hero image on a slow connection delays LCP past 2.5 seconds, which is the threshold Google uses to mark a page as needing improvement.
Compressing images perceptually, at the dimensions they actually render, is the single highest-leverage optimization you can apply to a marketing site.
Pick the right format for the right job
JPG remains the right default for photography. PNG is the right choice for graphics with sharp edges, transparency, or screenshots of text. WEBP delivers smaller files than both for the same perceived quality and is supported in every modern browser.
If you only export one format, export WEBP. If you need a fallback, pair WEBP with JPG using the picture element.
Step-by-step: compress images for the web
Follow this workflow for any marketing site, blog, product gallery, or landing page.
- 1Open the Docsora image compressor.
- 2Drop your JPG, PNG, or WEBP files - individually or in bulk.
- 3Pick Preserve Quality (30% reduction) for archive originals, Balanced (50% compression) for marketing imagery, or Maximum (80% reduction) for thumbnails and gallery tiles.
- 4Download the optimized images.
- 5Replace the originals in your CMS or asset pipeline.
Sizing rules that protect quality
Never serve an image larger than it renders. A hero that displays at 1600px wide should not be uploaded at 4000px - that is roughly 6x the bytes for zero visual benefit.
Standard sizing targets: hero images at 1600–1920px wide, in-body editorial at 1200px, product tiles at 600–800px, thumbnails at 300–400px. Compress each at the dimension it actually renders.
What perceptual encoding preserves
Perceptual encoding analyses what the human eye actually notices and spends bits accordingly. Faces, sharp edges, and high-contrast areas keep detail. Smooth gradients and uniform color regions get aggressive compression because the eye cannot tell the difference.
The result is a file that looks identical to the original at normal viewing distance but is 30–80% smaller.
Frequently asked questions
Related compression tools
Continue reading
Best Way to Reduce PDF Size in 2026
Large PDFs are the most common reason emails bounce, uploads fail, and review cycles stall. This guide walks through the technique professional teams use to shrink PDFs by 30–80% while keeping vector text crisp, scans readable, and signatures intact.
Reduce Email Attachment Size for Gmail & Outlook
Every modern mail provider caps attachment size, and bouncing messages cost time. This guide shows the cleanest way to get any PDF, deck, image, or spreadsheet under Gmail and Outlook limits - without splitting files, zipping folders, or falling back to cloud links.
Reduce Spreadsheet File Size: XLSX & CSV
Large XLSX files break dashboards, slow Excel to a crawl, and bounce off email servers. This guide shows how to shrink workbooks without touching formulas, pivot tables, or sheet structure - the way finance, ops, and analytics teams keep daily exports usable.
Ready to compress your files?
Try the Compress images for websites workflow described above - browser-based, secure, and finished in seconds.
Compress images for websites