Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can reduce image downloads without making them look worse at their intended display size, but lossy compression cannot preserve every original pixel. Start by removing images the page does not need, resize each asset toward its rendered dimensions, compare formats and quality settings, then inspect the results in the page and measure after deployment.

What “without losing quality” really means

Lossless compression reduces file size while preserving the encoded image data exactly. Lossy compression reduces bytes by discarding information, so it cannot be literally lossless. The practical goal for a web page is to choose an output that looks acceptable at the size and context in which visitors see it.

There is no single quality setting that works for every image. A photograph may tolerate lossy compression well; small text, diagrams and sharp color boundaries may show artifacts quickly. Compare both file size and appearance for each image at its actual display size.

Use this image-optimization workflow

  1. Remove what you do not need. If an image does not help the page, deleting the resource is often a better optimization than encoding it more aggressively. For geometric artwork, check whether a vector asset is more appropriate than a raster image.
  2. Resize for the rendered use. Do not make a small display slot download an unnecessarily large source. Create sensible width variants for different layouts and let the browser select among them.
  3. Choose formats based on the image. Compare JPEG, WebP and AVIF for photographs. For screenshots, logos or exact details, compare PNG and lossless WebP; test lossy choices cautiously.
  4. Compare several compression settings. Check the resulting bytes and view each candidate at the size readers will see. Do not select a setting solely because it produces the smallest file.
  5. Inspect difficult details. Look closely at small text, high-contrast edges, gradients and flat colors for halos, smearing, banding or color changes.
  6. Automate repeatable work and measure the live page. Remove unnecessary metadata where appropriate, build processing into your workflow, and assess the deployed page rather than assuming that smaller files alone guarantee a performance improvement.

Which image format should you use?

Format choice depends on content, visual quality, bytes, transparency or animation needs, browser support and the complexity of your delivery pipeline. No one format wins on every image. web.dev’s image performance guidance discusses format selection and delivery considerations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Nero AI Image Upscaler 365 | Enlarge Images & Sharpen Photos | AI Upscaling to 4K | Fix Blurry & Low-Resolution Pictures | Easy Photo Optimization | 1 PC | Windows 11/10
  • ✔️ AI Upscaling up to 8K: Enlarge small, low-resolution, or old photos with crisp details, clean edges, and fewer artifacts — perfect for prints, social media, blogs, and online galleries.
  • ✔️ Fix blurry or noisy photos: AI restores clarity by enhancing textures, sharpening faces, hair, and fine details while reducing noise and JPEG compression errors.
  • ✔️ Ideal for family photos, scans & mobile images: Improve pictures from smartphones, tablets, digital cameras, scanners, and old archives with professional-quality results.
  • ✔️ Fast & easy 1-click enhancement: Batch-process multiple photos at once and improve image quality instantly — no editing experience required.
  • ✔️ Reliable results & broad file support: Works with JPG, PNG, TIFF and more — stable AI processing even on old, compressed or damaged photos.
Image type Formats to compare What to inspect
Photographs JPEG, lossy WebP and AVIF Texture, gradients, file size and whether your audience needs a fallback
Screenshots, text and sharp edges PNG and lossless WebP; test lossy formats cautiously Text legibility, edge artifacts and exact colors
Logos and geometric artwork SVG when suitable; raster only when required Whether the image needs to be rasterized at all
Animated images Compare image formats and video for longer animations Playback behavior, file size and whether viewers need controls

WebP supports both lossy and lossless encoding and transparency; AVIF also offers lossy and lossless modes. If a newer format is not supported by browsers you need to serve, provide an appropriate fallback. Support changes over time, so check your own audience and browser requirements rather than relying on an undated universal support claim.

Resize images and let the browser choose

Compression is not a substitute for correct dimensions. If an image is rendered at a modest width, sending a much larger file can waste transfer bytes. Provide width candidates that suit the layouts your site serves. Use srcset for intrinsic-width candidates and sizes to tell the browser the expected rendered slot width; the browser can then select a suitable source. See web.dev’s guide to descriptive images.

<img
  src="/images/article-800.jpg"
  srcset="/images/article-400.jpg 400w,
          /images/article-800.jpg 800w,
          /images/article-1200.jpg 1200w"
  sizes="(max-width: 600px) 100vw, 800px"
  width="800"
  height="533"
  alt="A description of the image">

Adjust the candidate widths and sizes expression to match your actual layout. A candidate set is useful only when the files exist at the declared widths and the slot description reflects the page’s design.

Offer modern formats with a fallback

Use <picture> when you want to provide explicit format alternatives. Put supported modern formats before an <img> fallback. The browser selects a matching supported source; the nested <img> remains required. The type attribute lets the browser skip formats it does not support.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<picture>
  <source type="image/avif" srcset="/images/hero.avif">
  <source type="image/webp" srcset="/images/hero.webp">
  <img src="/images/hero.jpg" width="1200" height="800"
       alt="A description of the image">
</picture>

For responsive format choices, each source can also provide width candidates and a matching sizes value. Use <picture> for explicit format or art-direction choices; use srcset and sizes to describe width alternatives. The distinctions and examples are covered in web.dev’s prescriptive image guide.

If your server negotiates an image format from the request’s Accept header, shared caches need to distinguish variants. web.dev advises accounting for that variation with the Vary header. Without correct cache variation, a cache may serve an unsuitable format response to another request.

Compare compression settings without guessing

Use an image editor, command-line pipeline or comparison tool to create several candidates. Squoosh, ImageOptim and image-optimization services are among the options named by web.dev’s compression checklist. Squoosh supports side-by-side comparisons of encodings and settings. Treat any tool’s preset as a starting point, not a guarantee for every image.

  1. Keep the original so you can regenerate candidates without accumulating quality loss from repeatedly editing an already compressed file.
  2. Export a few quality levels in the formats you are evaluating.
  3. Record each output’s byte size and inspect it beside the original at the intended display size.
  4. Check details where artifacts are easiest to see: text, hard edges, flat backgrounds, gradients and fine textures.
  5. Choose the smallest candidate that still meets your visual requirements, then check that it behaves correctly in your site’s delivery path.

Lossy compression and chroma subsampling can make screenshots, interface captures, diagrams and small text look worse even when a photograph at a similar file size looks acceptable. Do not judge quality only by zooming far beyond the image’s page size; judge it in the context where it will be displayed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Metadata, automation and image CDNs

Image metadata may contain information your page does not need. Remove it where appropriate, while preserving anything your use case depends on. The web.dev checklist also recommends correctly scaled assets and automated workflows, which help keep large batches consistent.

An image CDN can automate resizing, format conversion and selection based on device or browser signals. This can be useful for a site with many images or a need for automated transformations. Before adopting one, compare control over outputs, format negotiation, cache behavior, workflow fit and current pricing. Provider pricing and specific service terms vary, so verify them directly before choosing.

Measure whether the page improved

Images are often among the larger and more common page resources. Reducing transferred bytes can lower network time, and an image may be the page’s Largest Contentful Paint (LCP) candidate. Efficient encoding can therefore contribute to faster display, but compression by itself does not guarantee a Core Web Vitals improvement. Layout, image dimensions, loading priority, network conditions and other resources also affect the outcome.

After deployment, measure the actual page under the conditions relevant to your audience. Confirm which image variant was requested, whether it was the intended format and dimensions, and whether the visible result remains acceptable. Recheck key pages after changes to templates or delivery rules, because the image that matters most for performance can differ from one page to another.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common image-compression problems

The compressed image looks blurry or blocky

The chosen lossy setting may be too aggressive, or the image may have been resized below the needed display resolution. Compare a higher-quality candidate and confirm that a suitable width variant is being selected.

Text or sharp edges look damaged

Those areas expose lossy artifacts readily. Compare PNG with lossless WebP, or use a less aggressive lossy setting if file-size savings remain worthwhile. Inspect at the real display size, especially for small labels and interface text.

The browser does not display a modern-format image

Check the format declared in the source, the actual response content type and the browser audience you intend to support. Use an <img> fallback inside <picture> when explicit format alternatives are appropriate.

A small screen downloads a large image

Check that srcset lists real width candidates and that sizes accurately describes the rendered slot. If every candidate is large, the browser has no smaller suitable file to choose.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Scrivar PDF Pro - Organize, Edit, Compress, Convert, Merge, eSign, OCR & 30+ tools | Lifetime License
  • EVERY PDF TOOL UNLOCKED - 30+ tools in one app: edit text and images, convert, merge, split, compress, sign, OCR, redact, watermark, batch process, and more. No feature gates, no upsells, nothing held back.
  • PAY ONCE, OWN FOREVER — A one-time purchase, not a subscription. Other apps runs $240/year — Scrivar is yours for life, with free updates included.
  • UNLIMITED eSIGN, BUILT IN — Send contracts and forms for signature and track every step. Recipients sign in their browser with no account or app needed. Replace DocuSign and save hundreds a year.
  • PC, MAC, AND WEB — Install on any Win 10/11 PC or macOS 11+ Mac (Intel or Apple Silicon), or work in your browser at scrivar.com. Same tools, same account, everywhere you work.
  • OCR + FULL OFFICE CONVERSION — Turn scanned documents into searchable, selectable text, and convert PDFs to and from Word, Excel, and PowerPoint with formatting kept intact.

A cache serves the wrong format variant

If the server selects a format using Accept, ensure shared caching accounts for the header variation with Vary. Otherwise, a cache may reuse one format response for requests that should receive another.

The page is still slow after reducing image bytes

Verify the deployed resource and the image’s role in the page. Image bytes are only one factor: loading priority, layout, dimensions, network conditions and other resources can still constrain display or LCP.

Or skip the browser setup

If your task is to capture a web page as an image rather than optimize image files you own, ScreenshotNeo is a website screenshot API and MCP server. Its API can return a PNG, JPEG, WebP or PDF from one GET request. Cookie banners, popups and chat widgets are removed before the shot; bot checks, blank pages and failed loads are never billed. An MCP server lets AI agents use tools to take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Every feature is on every plan. See the API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Get 1,000 free screenshots a month with no card.

Frequently Asked Questions

Does lossy compression preserve the original image exactly?

No. Lossy encoding discards information; compare its appearance at the intended display size before using it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should every image use WebP or AVIF?

No. Choose by content, visual result, size, transparency or animation needs, browser requirements and delivery complexity.

Will smaller images automatically improve Core Web Vitals?

No. Reduced bytes may help, particularly for an image that is an LCP candidate, but the deployed page must be measured.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.