Images

How to Compress Images for the Web (Step-by-Step)

Optimise every image type for maximum page speed with minimum quality loss. This guide covers resize, format, quality, and WebP conversion.

Difficulty
Beginner
Time
10 min

Last updated

FixFile.online Team

The FixFile.online editorial team — file format specialists, developers, and technical writers focused on practical file-fixing solutions.

How to Compress Images for the Web

Unoptimised images are the most common cause of slow websites. This guide shows you the exact steps to reduce image file size by 70–95% with no visible quality change.

Advertisement

Why Image Compression Matters for SEO

Google measures Largest Contentful Paint (LCP) — the time until the main image on a page loads. LCP is a direct search ranking factor.

  • LCP under 2.5 seconds: Good
  • LCP 2.5–4 seconds: Needs Improvement
  • LCP over 4 seconds: Poor (hurts rankings)

A single unoptimised hero image (5 MB PNG) can push LCP above 6 seconds on mobile. The same image optimised to 150 KB WebP loads in under 0.5 seconds.


Step 1: Identify Your Target Display Size

Before compressing, know the exact pixel dimensions the image will display at. Storing more pixels than the display uses is pure waste.

How to find display dimensions:

  • In Chrome: right-click the image on your page → Inspect → look for the <img> element → check the rendered width in the Styles panel
  • In your CMS: look for "image display size" or "thumbnail dimensions" in the template settings

Common web display sizes:

LocationTypical Display Width
Full-width hero1920px (1440px effective)
Blog content image800–1200px
Card thumbnail400–600px
Product image600–800px
Avatar / profile64–128px

Step 2: Resize to 2× Display Width (Retina Support)

Upload at 2× the display width to look sharp on Retina/HiDPI screens.

For an 800px blog image: upload at 1600px wide.

  1. Open Resize Image
  2. Set width to your target (e.g., 1600)
  3. Enable Lock Aspect Ratio
  4. Download

Step 3: Choose the Right Format

Image ContentFormat
PhotographWebP (or JPG fallback)
Logo with transparent backgroundWebP or PNG
Screenshot with textPNG
Logo/icon (vector)SVG
AnimationWebP

Step 4: Compress at Quality 80–85

  1. Open Compress Image
  2. Upload your resized image
  3. Quality: 80–85 for photographs, 85–90 for graphics with fine detail
  4. Download

Step 5: Convert to WebP

  1. Open WebP Converter
  2. Upload your compressed JPG or PNG
  3. Download the WebP

WebP is 25–34% smaller than JPG at the same quality. For a site with 50 images, this saves several MB per page load.

In your HTML:

<picture>
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.jpg" alt="Hero image" width="1600" height="900" loading="lazy">
</picture>

Expected Reductions

OriginalAfter OptimisationSaving
8 MB iPhone photo (PNG)180 KB WebP−97.8%
3 MB iPhone photo (JPG)130 KB WebP−95.7%
500 KB PNG logo40 KB PNG (lossless opt)−92%
2 MB screenshot120 KB PNG−94%

Checklist: Before Publishing Any Image

  • Width matches 2× display size
  • Format correct (WebP for photos, PNG for logos with transparency, SVG for icons)
  • Quality set to 80–85 for photos
  • width and height attributes set on <img> tags
  • loading="lazy" on all below-the-fold images

Frequently asked questions

Resize to 2× the display size for retina sharpness, compress to quality 80–85, and convert to WebP format. For a full-width hero on a 1440px desktop: 2880px wide WebP at quality 80. For a 800px blog image: 1600px wide WebP at quality 85.

At quality 80–85, the difference between compressed and uncompressed is imperceptible to human eyes on a normal screen. The data discarded is below the human visual threshold. Only at quality below 60–70 do artefacts become clearly visible.

Run your URL through Google PageSpeed Insights (pagespeed.web.dev). It explicitly flags "Serve images in next-gen formats," "Properly size images," and "Efficiently encode images" if any images need optimisation, with specific byte savings for each issue.