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

There is no universal sensitivity threshold for visual regression tests. Start with your tool’s definition of “threshold,” make screenshot capture repeatable, and adjust the relevant setting only after reviewing real diffs. In Playwright, threshold controls how different an individual pixel’s color may be before it counts as changed; maxDiffPixels and maxDiffPixelRatio instead limit the total number or share of changed pixels.

What a visual regression threshold measures

The word threshold does not mean the same thing in every screenshot-testing tool. Before changing a number, check whether it controls the comparison of each pixel or the total amount of difference allowed across the image. Those are separate decisions.

Playwright: per-pixel color tolerance

In Playwright’s toHaveScreenshot() options, threshold is the acceptable perceived color difference between corresponding pixels in YIQ. The documented default is 0.2; zero is strict, while one is lax. A pixel whose difference is within the tolerance is not counted as different. See the Playwright PageAssertions API documentation.

Playwright: total-difference limits

maxDiffPixels sets an absolute maximum count of differing pixels. maxDiffPixelRatio sets a maximum fraction from 0 to 1. Both are unset by default. These options limit how many pixels may differ; they do not change the per-pixel color comparison performed by threshold. A ratio of 0.01, for example, represents one percent of the compared image, not a one-percent color tolerance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.

Chromatic: its own threshold scale

Chromatic documents diffThreshold with a default of .063. Lower values make its comparison more sensitive and can increase false positives. This is Chromatic’s scale: do not copy .063 into Playwright or assume the two settings are equivalent. Chromatic supports setting the threshold at project, component/story, or test level, and offers an option to include anti-aliased pixels in diff calculations. Its guidance is to choose the lowest threshold that filters expected noise without hiding meaningful changes; it warns that a value such as 0.8 may prevent positioning changes from being detected. See Chromatic’s threshold documentation.

How to choose a starting value

Use the documented default for the tool as your baseline, not a number copied from another product or an unrelated example. Then tune against screenshots representative of your application. The right setting depends on the comparator, the visual details that matter, and how repeatable your captures are.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.
  1. Choose the comparison tool and capture environment. Fix the browser or Playwright project, viewport, scale, fonts, and test data. Use the same conditions for baseline and subsequent captures.
  2. Start at the tool’s documented default. For Playwright that is threshold: 0.2. For Chromatic, the documented diffThreshold default is .063; they are not interchangeable.
  3. Run representative tests and inspect the diff. Decide whether failures reflect an actual UI change, rendering noise, or unstable page content before editing the threshold.
  4. Change one control at a time. If subtle color changes are being missed, lower the per-pixel tolerance. If the pixel comparison is appropriate but too many changed pixels cause a failure, consider adjusting the absolute or proportional diff cap instead.
  5. Recheck meaningful changes. Confirm that the revised settings still flag the layout, color, or content changes the test is meant to catch. Do not keep raising tolerance just to quiet recurring failures.
  6. Review and commit accepted baselines deliberately. Playwright’s visual comparison guidance recommends reviewing and committing snapshots rather than treating every new output as automatically correct.

Make screenshots repeatable before loosening the comparison

A sensitivity setting cannot distinguish a real regression from a page that changes between runs. First control capture variability. Playwright’s screenshot assertion waits until two consecutive page screenshots match before comparing the last capture with the expectation. Its screenshot options disable animations by default and support masking volatile areas or applying a stylesheet with stylePath. The documentation also notes that browser, platform, and font rendering can cause snapshots to differ. See Playwright’s visual comparisons documentation.

  • Keep browser, operating system or CI image, viewport, and device scale consistent.
  • Use stable fonts and deterministic content wherever possible.
  • Disable or control animation and transitions; avoid capturing live timestamps or other changing data when they are not the subject of the test.
  • Mask or hide genuinely volatile regions rather than increasing a global tolerance until their changes disappear along with meaningful ones.
  • When using Chromatic, inspect its interactive diff and consider its anti-aliasing option if edge pixels are the source of noise.

Playwright uses CSS-pixel screenshot scale by default; device scale can produce larger screenshots on high-DPI displays. Keep that setting consistent because changing image dimensions or scale can affect the comparison.

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.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.

How to configure Playwright thresholds

Pass the controls to toHaveScreenshot(). This test uses the documented per-pixel default and illustrates an optional total-difference cap; the maxDiffPixelRatio value is only an example, not a generally safe recommendation.

import { test, expect } from '@playwright/test';

test('homepage visual appearance', async ({ page }) => {
  await page.goto('https://example.com');

  await expect(page).toHaveScreenshot('homepage.png', {
    threshold: 0.2,
    maxDiffPixelRatio: 0.01,
  });
});

For a strict pixel-count cap, use maxDiffPixels instead of—or, where appropriate, alongside—maxDiffPixelRatio. Keep the distinction clear: threshold decides which individual pixels count as different; the max-diff options govern how many such pixels are allowed. Playwright documents these options in its PageAssertions API.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

A documented ratio example is not a universal recommendation

Microsoft Learn’s Power Platform sample uses maxDiffPixelRatio: 0.01 with threshold: 0.2 to allow small rendering differences, and calls out dynamic timestamps as an area to avoid capturing in its model-driven app example. That is a configuration in that particular sample, not evidence that one percent is appropriate for every page. See the Microsoft Learn sample.

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

How to handle anti-aliasing and noisy diffs

Anti-aliasing changes can affect pixels along text and shape edges, but a broad tolerance can also hide genuine color or positioning changes. First inspect where the diff occurs and stabilize the browser, platform, fonts, viewport, and page content. In Playwright, use masking or a stylesheet for unstable regions; in Chromatic, review the interactive diff and its option for including anti-aliased pixels. Only then adjust one comparison setting and verify that meaningful changes remain visible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.

Common threshold problems and fixes

Symptom Likely cause What to do
Tests fail on text edges or other small pixel changes Rendering varies across browser, platform, fonts, or scale, or the per-pixel tolerance is too strict for the environment. Make capture conditions consistent first. Inspect the diff, then adjust the per-pixel threshold cautiously or use the tool’s anti-aliasing controls.
A subtle color change is not detected The per-pixel threshold is too lax. Lower the per-pixel tolerance and confirm the change is detected without producing unacceptable noise.
A small, localized difference fails the test The total-difference budget is too low for the observed capture noise, or the difference is a real regression. Inspect the changed area. If it is expected noise, tune maxDiffPixels or maxDiffPixelRatio; do not confuse either with color tolerance.
Increasing tolerance stops layout changes from failing The setting is too lax and may be hiding meaningful differences. Reduce it, inspect the changes it previously allowed, and fix nondeterministic inputs rather than suppressing them globally.
Screenshots differ because content moves or changes over time Animations, timestamps, dynamic data, or other volatile page regions are being captured. Control the content, disable animation, or mask or hide only the unstable region.
A copied threshold behaves differently in another tool Threshold scales and definitions vary by product. Use that tool’s own documentation and default; do not transfer a number between Playwright and Chromatic as if the scales matched.

Or skip the browser setup

If the goal is obtaining screenshots rather than configuring a browser-based visual test, ScreenshotNeo provides a website screenshot API and MCP server. A single GET request returns a PNG, JPEG, WebP, or PDF. For example, this cURL request saves a WebP screenshot; see the ScreenshotNeo API documentation for options.

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

ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status with headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month, with no card required.

Frequently Asked Questions

Does Playwright’s threshold of 0 mean screenshots must match exactly?

No. Zero is the strict end of Playwright’s documented per-pixel color-difference scale; total-diff limits are separate options.

Can I use the same threshold number in Playwright and Chromatic?

No. The tools define and scale their thresholds differently, so use each product’s own documentation and defaults.

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

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.