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

If a Next.js image looks blurry, inspect the original asset and the browser’s selected responsive file before changing configuration. Compare the source pixels with the CSS-rendered size and device-pixel density, then adjust quality, format, or delivery architecture. A higher quality value cannot restore detail that is absent from the source.

Use this troubleshooting order

  1. Open the original file at its natural pixel dimensions and check whether it is already soft, tiny, or heavily compressed.
  2. Measure the image’s actual CSS width and height, then compare those values with the source pixels and the screen’s device-pixel ratio.
  3. Inspect the resource selected by the browser (currentSrc), its natural dimensions, response format, and whether it came through Next.js optimization.
  4. Only after those checks, tune quality, formats, caching, or a custom loader.

This order prevents a common mistake: increasing compression quality when the browser is actually receiving an undersized candidate or the source itself lacks detail.

1. Start with the original asset

Quality settings cannot repair missing detail

The Next.js Image API warns that raising quality for a low-quality original increases file size without improving appearance. If the source is blurry when viewed at its natural dimensions, obtain a better export or redesign the page to display it smaller. Do not expect the optimizer to recreate texture, edge detail, or readable text.

A raster image enlarged beyond its intrinsic dimensions also becomes soft because the browser must estimate pixels that do not exist. Use a larger source when the design genuinely needs a larger rendering; otherwise constrain the displayed size.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

For background-like artwork, consider whether the visual is actually vector content. SVGs, animated GIFs, and very small files may not benefit from optimization; serving them with unoptimized can preserve the source without changing its quality, size, or format. See the Next.js Image API reference.

2. Match source pixels to layout and display density

Intrinsic dimensions are not CSS dimensions

For local or remote images, width and height establish the intrinsic aspect ratio and reserve space to reduce layout shift. They do not determine the final rendered size. CSS, a parent container, or the fill layout controls how large the image appears.

For example, an image rendered 600 CSS pixels wide on a device with a two-times pixel ratio needs a candidate close to 1,200 physical pixels wide to retain maximum detail. It does not have to be exactly that size, but the selected resource must be large enough for the actual layout. A source smaller than the rendered requirement will be upscaled and can look blurry.

Use fill when the parent owns the size

When a card, hero, or other container determines dimensions, use fill and make the parent positioned with a known size. Then use object-fit and related CSS to control cropping. The parent must provide a real width and height; otherwise the browser has no reliable box in which to render the image.

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.

Describe responsive width with sizes

Next.js generates responsive srcset candidates. The sizes prop tells the browser how wide the image will be at each viewport width, allowing it to choose an appropriate file. Without an accurate hint, a browser can select a candidate that is too small or download more bytes than necessary.

Suppose a grid shows one-third of the viewport on wide screens and a full-width image on narrow screens:

import Image from 'next/image'

export default function ProductImage({ src, alt }) {
  return (
    <Image
      src={src}
      alt={alt}
      width={900}
      height={600}
      sizes="(min-width: 1024px) 33vw, 100vw"
    />
  )
}

The expression is only an example. Replace it with the widths your layout actually produces. Next.js documents image sizing in its Getting Started: Images guide, while web.dev explains how srcset and sizes interact in Responsive images.

Rank #2
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

3. Verify what the browser really downloaded

Inspect the element and selected URL

Open DevTools, select the image element, and check its rendered dimensions. In the console, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const img = document.querySelector('img')
({
  currentSrc: img.currentSrc,
  rendered: { width: img.clientWidth, height: img.clientHeight },
  natural: { width: img.naturalWidth, height: img.naturalHeight },
  devicePixelRatio: window.devicePixelRatio
})

currentSrc identifies the candidate chosen from srcset. Compare its natural width with the rendered width multiplied by devicePixelRatio. Also inspect the Network panel for the response’s content type, transfer size, and whether the URL is an optimizer endpoint or the original file. This deployed-page check matters because JSX alone cannot reveal the browser’s final choice.

Interpret the results

  • Natural width is smaller than the density-adjusted display: provide larger source files or correct sizes.
  • Natural dimensions are adequate but the source preview is soft: replace or re-export the original.
  • The selected file is unexpectedly large: correct an overly broad sizes value or review the layout.
  • The format differs from expectations: check configured formats and the request’s Accept header.

4. Tune the quality prop deliberately

What the setting does

Next.js documents quality as an integer from 1 through 100, with 75 as the documented default. Higher values generally increase fidelity and transfer size; lower values reduce bytes and can reduce sharpness. There is no universal best number. Compare representative images at their real display size and measure both visual artifacts and transferred bytes.

<Image
  src="/images/landscape.jpg"
  alt="Mountain landscape"
  width={1600}
  height={900}
  quality={85}
  sizes="(min-width: 900px) 70vw, 100vw"
/>

Use a higher value for fine textures, small text, or photographic detail only when visual comparison justifies the extra bytes. Do not set every image to 100 by default.

Next.js 16 allowlist requirement

Starting with Next.js 16, configure allowed quality values in images.qualities. If a component requests a value outside that list, Next.js uses the closest allowed value. A direct Image Optimization API request with an unconfigured quality returns HTTP 400. Confirm the rules for the Next.js version installed in your project before changing configuration.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
// next.config.js
const nextConfig = {
  images: {
    qualities: [60, 75, 85,  is not valid?]
  }
}

module.exports = nextConfig

Use only numeric values in the allowlist. A valid example is:

const nextConfig = {
  images: {
    qualities: [60, 75, 85, 95]
  }
}

module.exports = nextConfig

5. Choose formats based on the asset

Next.js can negotiate configured output formats using the browser request’s Accept header. WebP is documented as the default configured format, and AVIF can be enabled. If multiple configured formats match, array order determines which one is selected. If none matches, or the source is animated, the optimizer falls back to the original format. AVIF can also require more cached variants.

WebP and AVIF may reduce file size compared with JPEG or PNG, but smaller does not automatically look sharper. Test photographs, fine edges, gradients, transparency, and text separately. Keep browser support and fallback behavior in your decision. The format and negotiation details are in the Image API reference; web.dev covers broader image-performance trade-offs at Image performance.

// next.config.js
const nextConfig = {
  images: {
    formats: ['image/avif', 'image/webp']
  }
}

module.exports = nextConfig

Do not add formats merely because they are newer. Compare output at the rendered size and account for cache storage and request negotiation.

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

6. Configure remote images safely

Supply dimensions or use fill

Next.js cannot inspect a remote file at build time. Provide accurate width and height, plus optional blur data, or use fill inside a sized parent.

Restrict hosts with remotePatterns

Use narrowly specified protocol, hostname, path, and (where applicable) query settings rather than allowing an entire domain. This limits which remote resources the optimizer can fetch. Follow the current examples in the remote-image documentation.

Authentication headers are not forwarded

The built-in optimizer does not forward authentication headers when fetching a source. If the image requires authentication, disable optimization for that image or place it behind a delivery arrangement that can fetch it without those headers. A custom loader is appropriate when a CMS or image CDN already performs resizing and transformation; Next.js documents custom loaders in its image guide and API reference.

7. A repeatable quality workflow for teams

  1. Inventory assets: record natural pixel dimensions, file type, transparency, animation, and visible compression defects.
  2. Define layout targets: list rendered widths at breakpoints and the device densities you support.
  3. Validate candidates: use DevTools and currentSrc on representative pages and devices.
  4. Set responsive hints: add accurate sizes values and verify the parent dimensions when using fill.
  5. Test quality values: compare a small, representative image set at actual display size, recording visual defects and transfer bytes.
  6. Test formats: include photographs, text-heavy graphics, gradients, transparency, and animation.
  7. Review operational constraints: check cache variation, remote-host access, authentication, and whether a custom loader is justified.

This process treats fidelity, rendered width, density, transfer size, asset behavior, and operational fit as separate criteria instead of optimizing one number in isolation.

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

Common failure modes and fixes

The image is still blurry after setting quality={100}

Check the source’s natural pixels and the selected candidate first. A poor original or undersized currentSrc cannot be repaired by output quality.

Desktop looks fine, mobile looks soft

Inspect the mobile candidate and your sizes expression. The expression may describe a width larger than the real mobile slot, causing an inefficient choice, or smaller than it, causing an undersized candidate.

The image is sharp but shifts the page

Provide correct intrinsic width and height, or give a fill image a properly sized parent. These values reserve the aspect-ratio space; CSS still controls the final dimensions.

A remote image fails to load

Verify that its URL matches a narrowly configured remotePatterns entry and that dimensions or fill are supplied. If authentication is required, remember that the built-in optimizer does not forward headers.

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

A quality request returns HTTP 400

On Next.js 16 or later, check images.qualities. Add the requested value to the allowlist or request an allowed value.

AVIF increases storage or cache complexity

Multiple formats create more variants, and AVIF may require more cached variants. Compare the byte savings with cache and operational costs before enabling it everywhere.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For automated website screenshots, ScreenshotNeo is a practical alternative: it removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with the result identified by X-Page-Verdict and X-Billed headers; and its MCP server lets Claude, Cursor, or another MCP client call take_screenshot, get_page_info, and capture_pdf. It supports PNG, JPEG, WebP, and PDF output plus responsive and full-page options.

One GET request is enough:

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

See the complete parameter list in the ScreenshotNeo documentation. The same request in Python:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import requests
r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

And Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

Every feature is available on every plan: full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets or custom viewports, retina scale, PDF controls, HTML/CSS rendering, custom JavaScript and CSS, clicks, waits, request blocking, headers and cookies, timezone and geolocation, transparent backgrounds, resizing, selectable cache TTL, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage reporting, and an OpenAPI specification. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Best Value
Sale
JavaScript and jQuery: Interactive Front-End Web Development
  • JavaScript Jquery
  • Introduces core programming concepts in JavaScript and jQuery
  • Uses clear descriptions, inspiring examples, and easy-to-follow diagrams

FAQ

Does quality={100} produce a lossless image?

No. The value controls the optimizer’s output trade-off within the selected format; it does not make JPEG, WebP, or AVIF lossless and cannot restore source detail.

Should every image use fill?

No. Use intrinsic dimensions when the image has known dimensions. Use fill when a sized parent and CSS layout determine the image box.

Can I choose the exact srcset URL?

Normally the browser chooses from candidates generated by Next.js. You influence that choice with accurate layout information, especially sizes, rather than hard-coding one URL.

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

Frequently Asked Questions

What is the fastest first check for a blurry Next.js image?

Inspect the original file and compare its natural pixel dimensions with the rendered CSS width and device-pixel ratio before changing quality.

Why can the same image look sharp on one device and soft on another?

Responsive candidates differ by viewport and density; an inaccurate sizes hint or undersized source can make one device receive too few pixels.

The Bottom Line

Improve Next.js image quality by matching a sound original to the real rendered size, validating the browser’s selected candidate, and only then tuning quality and formats. Configuration cannot replace missing source detail.

Quick Recap

SaleBestseller No. 1
HTML and CSS: Design and Build Websites
HTML and CSS: Design and Build Websites
HTML CSS Design and Build Web Sites; Comes with secure packaging; It can be a gift option
$15.74
SaleBestseller No. 2
Web Design with HTML, CSS, JavaScript and jQuery Set
Web Design with HTML, CSS, JavaScript and jQuery Set
Brand: Wiley; Set of 2 Volumes
$35.05
SaleBestseller No. 3
SaleBestseller No. 5
JavaScript and jQuery: Interactive Front-End Web Development
JavaScript and jQuery: Interactive Front-End Web Development
JavaScript Jquery; Introduces core programming concepts in JavaScript and jQuery; Uses clear descriptions, inspiring examples, and easy-to-follow diagrams
$23.44

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.

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