Skip to content

Image

How to Optimize Images for the Web: Compression, Resizing and Formats

9 min read

Images are the heaviest assets on almost every web page. Studies routinely show that images account for over 50% of a web page's loaded bytes, and every unoptimized JPEG that leaves a camera at 8 MB adds seconds to your load time. Optimizing images is the single highest-impact performance win available to most sites. This guide explains the three levers you control — compression, resizing and format — and how to use them together.

Why image size matters

Your visitors' experience is directly tied to how fast your pages load. Large images delay the first paint, push above-the-fold content down, consume mobile data and hurt your search ranking. Core Web Vitals — the metrics Google uses to measure loading experience — weight properly sized and compressed images heavily. Optimizing before upload is always better than relying on the browser to cope.

  • Largest Contentful Paint (LCP): The main hero image is usually the largest element; its size drives your LCP score.
  • Data usage: Mobile users on limited plans pay for every kilobyte of unoptimized imagery.
  • Bounce rate: Every additional second of load time measurably increases the chance visitors leave.
  • Storage and bandwidth: Smaller files mean cheaper hosting and faster delivery through CDNs.

Compression: quality vs. file size

Compression removes redundant data from an image file. There are two families:

  • Lossy compression (JPEG, WebP): permanently discards some visual detail to shrink the file. The trick is finding the level where the human eye cannot tell the difference — for JPEG that is usually a quality setting between 70 and 85.
  • Lossless compression (PNG, WebP lossless): preserves every pixel exactly, useful for screenshots, diagrams and assets with text where artifacts are obvious.

A modern image optimization workflow converts photographs to highly compressed WebP (or JPEG for compatibility) and keeps PNG for images that need sharp text or transparency. When you compress in the browser, the work happens locally and the original never leaves your device.

Resizing: serve only what you display

A 6000×4000 pixel photo displayed in a 1200-pixel-wide slot wastes most of its data. Resizing to the largest size your layout actually uses is often the biggest single reduction available: shrinking a 24 MB photo to 1920px wide routinely brings it below 2 MB before any compression is applied. Rules of thumb:

  • Crop or resize to the exact display size, not larger.
  • Consider retina displays: a 2× image (display width × 2) balances crispness with file size.
  • Resize first, then compress — working from a smaller image is faster and produces mathematically better results.

Choosing the right format

Quick format decision guide

Photos → WebP or JPEG (quality 75–85). Screenshots, text, logos → PNG or lossless WebP. Everything web (best when supported) → WebP — about 25–35% smaller than JPEG at equal quality.

FormatBest forNotes
JPEGPhotos without transparencyLossy; quality sliding scale; universal support
PNGText, logos, screenshotsLossless; supports transparency; heavier
WebPGeneral web usageLossy + lossless; transparency; smaller than JPEG
HEICiPhone storage / iOSModern, efficient; limited web support
SVGLogos, icons, illustrationsVector; scales infinitely; tiny for simple art

Choosing the format is a one-way conversation with your use case: a photo needs photographic compression, a logo needs sharp edges and transparency. Matching the format to the image type typically saves 30–50% compared to a single default format for everything.

A practical five-step workflow

  1. Resize to your largest display width (e.g. 1920px for hero images, 800px for article body).
  2. Choose a format based on content: WebP for photos, PNG for graphics with text.
  3. Compress starting at quality 80 and step down until you find the smallest acceptable size.
  4. Preview the result side by side with any existing original to confirm no visible degradation.
  5. Export and, for a website, serve it with proper dimensions in your markup or a next-gen format stack.

Optimizing images in Convrs

Convrs offers a full set of browser-based image tools that follow exactly this workflow:

  • Image compressor tunes quality to hit a target size.
  • Image resizer sets exact width and height.
  • JPG to WebP and WebP to PNG convert between formats.

Every conversion runs entirely in your browser via WebAssembly. Your photos never leave your device, there is no upload queue to wait through, and no limit on how many files you process.

Buy me a coffee