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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Puppeteer screenshots differ when headless and headed Chrome do not render the page with the same inputs. Match the viewport and device scale factor, screen geometry, Chrome build, GPU path, fonts and libraries, page readiness, and screenshot options before treating a visual difference as a page bug. Headless Chrome uses a configurable virtual screen; headed Chrome uses the platform’s physical display environment, so identical JavaScript alone does not guarantee identical pixels.

What changes between headless and headed Chrome?

Headless and headed are not simply two ways to show or hide the same window. They can differ in how Chrome models the display, how it composites and rasterizes content, and what system fonts and graphics libraries are available. A screenshot comparison is meaningful only after those inputs are controlled.

Virtual screen versus physical display

Chrome’s headless mode uses a configurable virtual screen independent of attached displays. A headed run instead operates in the platform’s physical screen environment, whose scale factor, size, orientation, and available work area can differ. Chrome’s --screen-info switch controls virtual-screen origin, size, scale factor, orientation, and work area. See Chrome’s headless documentation.

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.

Viewport, device scale factor, and responsive layout

Puppeteer’s viewport width and height are CSS pixels. Its deviceScaleFactor defaults to 1; setting it to 0 restores the system default. Different viewport dimensions can activate different CSS breakpoints, while a different device scale factor (DPR) changes output pixel dimensions and can alter antialiasing. Set both explicitly rather than inheriting environment defaults. The Puppeteer Viewport documentation describes these settings.

#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

GPU compositing and headless shell

The GPU and compositing path can vary with the Chrome build and available drivers. Puppeteer documents that chrome-headless-shell disables GPU compositing unless launched with --enable-gpu. If your headed run uses GPU acceleration but the shell does not, the resulting raster output may differ. Don’t add GPU flags blindly: choose the rendering path you actually need, then keep it consistent across local and CI environments. See Puppeteer troubleshooting.

Fonts and native libraries

Chrome’s output depends on installed fonts and graphics-related native libraries. This is especially important when local development is on macOS or Windows and CI runs in a Linux container. Puppeteer’s Linux troubleshooting documentation names packages including fonts-liberation, libcairo2, libpango-1.0-0, and libgbm1. Missing fonts can change glyph shapes, text width, line breaks, and ultimately layout; different raster dependencies can affect edges even when layout appears unchanged.

Readiness and capture semantics

A page captured before web fonts, images, or animations settle can differ from a later capture. So can a change from viewport capture to full-page capture, a different clip rectangle, or a transparent background. Puppeteer’s screenshot options include fullPage, clip, captureBeyondViewport, fromSurface (default true), omitBackground, and image type. Keep these identical when diagnosing pixels. See Puppeteer ScreenshotOptions.

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

How to make screenshots reproducible

Use one defined capture configuration for both environments. The following example pins the important viewport, waits for navigation and web fonts, and uses explicit screenshot options. It assumes Puppeteer is installed and that the Chrome binary Puppeteer launches is available.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  1. Pin the browser environment. Use the same Puppeteer package version and Chrome-for-Testing build locally and in CI. Keep operating-system image and font packages consistent as well.
  2. Set screen and viewport values. Choose the target CSS viewport and DPR explicitly. In headless runs, model the headed screen with --window-size or, where needed, --screen-info.
  3. Choose one GPU path. Keep headless/headful mode and Chrome arguments consistent. If using chrome-headless-shell and GPU rendering is required, Puppeteer documents adding --enable-gpu.
  4. Wait for stable content. Use the same readiness policy for each run, then wait for fonts and images and neutralize animation if it affects the comparison.
  5. Use identical capture options. Keep image type, full-page behavior, clipping, surface capture, and background treatment the same.
  6. Check dimensions before diffing. Compare image width, height, and metadata first. A DPR mismatch can trigger a visual regression even if CSS layout is otherwise correct.

Runnable Puppeteer example

This CommonJS script is intended to run under Node.js with Puppeteer installed. Set HEADLESS=false for headed mode and leave it unset for headless mode. Use the same Chrome installation and environment when comparing results.

const puppeteer = require('puppeteer');

(async () => {
  const headless = process.env.HEADLESS !== 'false';
  const browser = await puppeteer.launch({
    headless,
    args: ['--window-size=1440,1000'],
  });

  try {
    const page = await browser.newPage();
    await page.setViewport({
      width: 1440,
      height: 1000,
      deviceScaleFactor: 1,
    });

    await page.goto('https://example.com', {
      waitUntil: 'networkidle0',
      timeout: 30000,
    });
    await page.evaluate(() => document.fonts.ready);
    await page.screenshot({
      path: 'shot.png',
      type: 'png',
      fullPage: true,
      captureBeyondViewport: true,
      fromSurface: true,
      omitBackground: false,
    });
  } finally {
    await browser.close();
  }
})();

Replace https://example.com with the page under test. networkidle0 is a practical example, not a universal definition of readiness: pages with polling, analytics, or long-lived requests may never become idle. In that case, use a page-specific readiness condition and a bounded timeout consistently. Chrome’s headless command-line documentation describes its --timeout behavior: Headless Chrome.

Animation and dynamic content

For visual tests, stabilize content that changes independently of the rendering mode. Prefer waiting for a meaningful selector or application-ready signal. If animations or rotating content matter, disable or freeze them consistently using test CSS or page logic. Avoid relying on an arbitrary sleep as the only readiness check: it can be too short under load and unnecessarily slow when the page is already ready.

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

How to diagnose a mismatch

When two screenshots differ, compare configuration in this order. Start with the most common high-impact causes, and change one variable at a time.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Comparison axis What to verify Typical symptom
Chrome and Puppeteer versions Same package and Chrome-for-Testing build Broad or unexplained raster differences between machines
Viewport CSS size Same explicit width and height Different responsive layout, wrapping, or element positions
Device scale factor Same explicit DPR, not a system default Different image dimensions or antialiasing
Screen geometry Headless virtual size, scale, orientation, and work area versus headed display Window size or display-dependent behavior differs
GPU and compositing Same mode, arguments, shell choice, and driver availability Raster/compositing differences, often around effects or edges
Fonts and libraries Same fonts and Linux native dependencies Changed glyphs, text widths, line wraps, or rendering edges
Readiness timing Same navigation and page-ready condition; fonts and images loaded Missing assets, changing content, or inconsistent animation frames
Screenshot options Same full-page, clip, surface, background, and output type Different crop, dimensions, transparency, or capture area

If dimensions match but only text differs, inspect fonts and font readiness first. If the entire page layout changes, verify the CSS viewport and DPR before adjusting application CSS. If differences are concentrated around shadows, transforms, or antialiased edges, compare the GPU/compositing path and browser build. If the images have different heights, confirm that both runs use the same full-page and beyond-viewport behavior.

Common errors and fixes

“It looks right on my desktop, but CI fails”

CI may use a different Chrome build, Linux font set, native libraries, DPR, or GPU availability. Pin the browser and dependencies and set the viewport explicitly. Do not assume the headed machine’s physical display defaults carry over to a headless container.

Text wraps differently or glyphs look wrong

Check that the intended fonts are installed in both environments and wait for document.fonts.ready before capture. On Linux, compare the font and graphics packages listed in Puppeteer’s troubleshooting guidance. A fallback font can be visually similar yet wide enough to change line wrapping.

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

Image sizes differ even though the viewport is the same

Viewport dimensions are in CSS pixels; the screenshot bitmap also reflects device scale factor. Set deviceScaleFactor explicitly, then compare actual PNG dimensions and metadata. Confirm both captures use the same image type and capture mode.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Headless-shell output differs around composited elements

Check whether the run uses chrome-headless-shell and whether GPU compositing is enabled. Puppeteer documents that shell disables it by default unless launched with --enable-gpu. Also verify the available graphics drivers and that the headed run uses a comparable path.

Intermittent differences or missing images

The page may not be ready when the screenshot is taken. Wait for a specific application-ready selector, fonts, and required images; use one timeout policy. Chrome’s headless CLI --timeout bounds waiting, but a timeout by itself cannot ensure that the application has reached the state your test needs.

Crop, background, or page height does not match

Review fullPage, clip, captureBeyondViewport, fromSurface, and omitBackground. A transparent background is not equivalent to a painted white page, and a clipped viewport is not a full-page capture. Use precisely the same screenshot options in both runs.

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

Or skip the browser setup

If you need a consistent website capture without maintaining a local browser and its display, font, and dependency setup, ScreenshotNeo is a website screenshot API and MCP server. It accepts one GET request for a URL and returns PNG, JPEG, WebP, or PDF. Its clean-shot flow accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. AI agents can use its MCP server tools, including take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. See the ScreenshotNeo API documentation.

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

Sign up for 1,000 free screenshots a month, with no card required.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

When pixel identity is realistic

Matching browser settings substantially improves reproducibility, but it does not make every capture universally pixel-identical across operating systems and graphics stacks. Pixel-level comparisons are most reliable when the browser build, runtime image, fonts, libraries, viewport, DPR, readiness state, and capture options are pinned together. Where a platform’s physical display behavior is the subject of the test, compare in that same headed environment; where the page’s web rendering is the subject, define a single controlled environment and treat it as the baseline.

Frequently Asked Questions

Does headless Chrome always render differently from headed Chrome?

No. Differences arise when rendering inputs differ; matching the browser, screen settings, dependencies, readiness, and capture options can reduce them substantially.

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

Should I use `–screen-info` or `–window-size`?

Use `–window-size` for a straightforward headless window size. Use `–screen-info` when you need to model virtual-screen properties such as scale factor, orientation, origin, or work area.

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.