The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Make headed and headless screenshots deterministic by running both in the same OS or container, with the same Playwright and browser versions, fonts, viewport, device scale, locale, timezone, animation state, data, and screenshot options. Set those values explicitly, then investigate differences in that order. Do not raise a pixel-diff threshold until environmental causes are eliminated.
Why headed and headless screenshots differ
Headed mode displays a browser window; headless mode renders without one. The test code can be identical while the rendering context is not. Playwright documents differences caused by the host operating system, browser version, browser settings, hardware, power source, headless mode and other environmental factors. Fonts and platform text-rendering are especially visible in visual comparisons.
Snapshot names also encode the browser and platform because the same page can render differently across engines and operating systems. A test that passes with a local headed baseline can therefore fail in CI headless even when the application has not changed.
There is no authoritative universal percentage for how often these differences occur, how many pixels should change, or which comparison threshold is always safe. Treat the mismatch as a reproducibility problem rather than assuming the headless image is wrong.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Fix sequence: make every rendering input explicit
1. Pin the execution environment
Generate baselines and compare them in the same container image or operating-system image. Pin the Playwright package and the browser build it installs. Install the same font files in local and CI environments; a fallback font changes glyph widths, line wrapping and element heights.
- Use one OS or container image for baseline generation and verification.
- Lock the Playwright version and browser revision in your dependency and CI configuration.
- Install identical fonts, including web-font prerequisites and any fonts used by your product.
- Keep locale, timezone and other process-level settings stable.
If you must compare two environments, record their image digest, browser version, Playwright version and installed fonts alongside each artifact. That turns an unexplained diff into a reproducible comparison.
2. Set viewport and device scale factor
Define the browser context rather than relying on machine defaults. Playwright’s emulation controls include viewport, screen size, user agent, touch behavior and device scale factor. A different viewport can trigger a breakpoint; a different device scale factor changes rasterization and image dimensions.
import { chromium } from '@playwright/test';
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
viewport: { width: 1440, height: 900 },
deviceScaleFactor: 1,
locale: 'en-US',
timezoneId: 'UTC',
});
const page = await context.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({ path: 'headless.png', fullPage: true, scale: 'css' });
await browser.close();
Use the same values in headed and headless launches. The exact numbers are a project decision; consistency matters more than choosing a particular desktop size.
Recommended Free Tools
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
3. Keep screenshot scale identical
Playwright’s scale option controls output density. scale: "css" emits one image pixel per CSS pixel. scale: "device" emits one pixel per device pixel and can produce larger high-DPI images. Select one value and use it in both modes, otherwise a comparison can fail even when the layout is the same.
4. Freeze animation and transition state
Visual assertions disable animations by default: finite animations are fast-forwarded and infinite animations are canceled for capture. Preserve that behavior explicitly, or inject a screenshot-only stylesheet that disables transitions and animations. Also wait for the application state you intend to compare; a screenshot taken during hydration is not equivalent to one taken after data loads.
import { test, expect } from '@playwright/test';
test('stable visual', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveScreenshot('home.png', {
animations: 'disabled',
caret: 'hide',
scale: 'css',
fullPage: true,
});
});
5. Remove transient UI instead of masking real defects
Use caret: 'hide' to prevent a blinking text cursor. Mask dynamic locators and use style or stylePath for clocks, rotating promotions, advertisements and third-party widgets. Prefer masking or deterministic fixtures to increasing the comparator threshold: a relaxed threshold can hide a genuine layout regression.
await expect(page).toHaveScreenshot('dashboard.png', {
animations: 'disabled',
caret: 'hide',
scale: 'css',
style: `
*, *::before, *::after {
animation: none !important;
transition: none !important;
}
.live-clock, .rotating-ad, .chat-widget {
visibility: hidden !important;
}
`,
mask: [page.locator('[data-testid="current-time"]')],
});
6. Capture the same scope and options
Decide whether the contract is a viewport shot, an element shot, or a full-page image. Use the same fullPage, clip, locator, and screenshot options in both runs. Full-page capture can expose lazy-loaded content that a viewport capture never reaches, so it must be part of the test definition rather than an ad-hoc debugging change.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
A deterministic Playwright project
Put shared rendering inputs in the project configuration so every developer and CI job inherits them. Keep headed and headless projects identical except for the headless launch setting when you are deliberately diagnosing that difference.
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
use: {
...devices['Desktop Chrome'],
viewport: { width: 1440, height: 900 },
deviceScaleFactor: 1,
locale: 'en-US',
timezoneId: 'UTC',
colorScheme: 'light',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium-stable',
use: { ...devices['Desktop Chrome'] },
},
],
});
Generate a baseline and run comparisons with this same project and environment. The configuration controls are stable, but the correct viewport, locale and browser project depend on the product you are testing.
Compare environments in a fixed order
| Check | What to make identical | Typical symptom when it differs |
|---|---|---|
| OS or container | Same image, libraries and rendering stack | Text anti-aliasing, line breaks or subtle color changes |
| Browser and Playwright | Same engine, browser build and package version | Layout, CSS or screenshot behavior changes |
| Fonts | Same installed font files and loading state | Different glyph widths, wrapping and element heights |
| Viewport | Identical width and height | Responsive breakpoint or reflow differences |
| Device and screenshot scale | Same deviceScaleFactor and scale |
Different image dimensions or rasterization |
| Locale and timezone | Same browser context and process settings | Dates, numbers, text direction or localized content changes |
| Timing and data | Same animation, network and fixture state | Loading spinners, rotating content or changed values |
| Capture scope | Same viewport, element, clip or full-page setting | Missing, extra or differently sized regions |
| Comparator | Threshold only after deterministic causes are fixed | False failures from unavoidable raster differences |
Troubleshooting common failures
“It passes headed locally but fails headless in CI”
Start by running the local test in the same CI container and browser revision. Verify fonts and viewport before changing application code. If the image then matches, the original failure was environmental.
Text wraps on one run
Compare installed fonts, font-loading completion, viewport width and device scale factor. Wait for the relevant web font or use a deterministic font setup. A fallback font can alter wrapping without any CSS change.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
The image is a different size
Check deviceScaleFactor, scale, viewport dimensions and whether one capture uses fullPage. A device-pixel screenshot is expected to be larger than a CSS-pixel screenshot on a high-DPI context.
Only animated or live regions differ
Disable animations, hide the caret, mask dynamic locators and freeze API data. For third-party widgets, inject a screenshot stylesheet or block the widget in the test environment. Do not mask the entire page; keep the assertion sensitive to meaningful changes.
Differences remain after all settings match
Confirm that both runs use the same browser binary and OS libraries, then inspect locale, timezone, color scheme, reduced-motion preferences and network responses. Compare a small element first, then expand to full-page capture. Adjust a comparator threshold only when the remaining variation is understood and acceptable.
Reliability and performance practices
- Use a reusable, pinned CI image so browser startup and font installation are not variable.
- Wait for a meaningful readiness signal (such as a page-specific selector or settled data), not an arbitrary long sleep.
- Prefer deterministic fixtures and mocked clocks for pages that display time or random values.
- Keep screenshot options in a shared helper or test configuration to prevent headed and headless drift.
- Store the environment metadata with failed artifacts so a later rerun can reproduce the exact context.
- Use element screenshots while debugging to isolate the first divergent component, then restore the agreed capture scope.
Or skip the browser setup
If your goal is a clean URL screenshot rather than a Playwright visual regression, ScreenshotNeo provides a single request and documents the options at https://screenshotneo.com/docs/. It accepts the consent banner like a visitor, removes more than 60 known consent platforms plus newsletter popups and chat widgets before capture, and lets you turn each cleanup step off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed; response headers identify the page verdict and whether it was billed.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. It supports full-page and element capture, dark mode, device presets or custom viewports, retina scale, PDF controls, custom CSS and JavaScript, clicks, waits, request and resource blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, selectable cache TTLs, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Parameters used by other screenshot APIs also work for easier migration.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
| Plan | Included screenshots | Price |
|---|---|---|
| Free | 1,000 per month | $0, no card |
| Starter | 3,000 | $5 |
| Growth | 15,000 | $15 |
| Pro | 60,000 | $39 |
| Scale | 250,000 | $99 |
| Business | 1,000,000 | $249 |
Every feature is included on every plan, and yearly billing provides two months free. Start with 1,000 free screenshots a month with no card; paid plans start at $5 for 3,000.
FAQ
Should headed mode be the baseline?
No. The baseline should be generated in the same environment and mode used for comparison. Choose the mode that matches production or CI, then keep it stable.
Can I solve every mismatch by increasing the threshold?
No. A threshold is appropriate only for understood, unavoidable raster variation. It should not conceal changed fonts, layout, content or timing.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchDo I need separate snapshots for each browser?
Yes, when you intentionally support multiple engines or platforms. Rendering and fonts can differ, so keep browser- and platform-specific projects and baselines.
Frequently Asked Questions
Should headed mode be the baseline?
No. Generate and compare baselines in the same environment and mode used by the test target.
Can I solve every mismatch by increasing the threshold?
No. Increase it only for understood, unavoidable raster variation after deterministic causes are fixed.
Do I need separate snapshots for each browser?
Yes, when supporting multiple engines or platforms, because rendering and fonts can differ.
Quick Recap
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.

