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

If a Selenium PNG is twice as wide and twice as tall as the viewport you configured, first determine whether the result is an old ChromeDriver defect, intentional device emulation, or the expected high-density output of a Retina environment. Record your Chrome, ChromeDriver, Selenium, operating-system, and headed/headless versions; read back the WebDriver window and page metrics; inspect window.devicePixelRatio; and compare those values with the actual PNG dimensions. ChromeDriver 78.0.3904.11 specifically listed “Fixed screenshot size on retina display,” but that historical release note is not proof of a current universal bug. Configure the output your tests actually need—CSS-pixel-sized or high-density—and assert the dimensions in the same environment used by CI.

What “double resolution” means

WebDriver exposes sizes in CSS pixels, while a screenshot file contains device pixels. On a Retina display, a page that is 1,440 CSS pixels wide can produce a 2,880-pixel-wide bitmap when the effective device pixel ratio is 2. If both width and height double, the bitmap contains four times as many pixels. That arithmetic explains one common symptom; it does not prove that every Retina capture should be downsampled.

  • Window dimensions: the outer browser window size controlled through WebDriver.
  • Viewport dimensions: the page’s CSS layout area, available through JavaScript.
  • Device pixel ratio (DPR): the browser’s CSS-pixel-to-device-pixel scale, reported by window.devicePixelRatio.
  • PNG dimensions: the physical pixel width and height stored in the file.

Decide which artifact your test requires. A CSS-pixel baseline is usually easier to compare across machines. A high-density baseline preserves Retina detail and is valid when your consumer expects device-pixel output. The fix is to make that choice explicit and reproduce it, not to apply a flag blindly.

Check versions before changing scale

Capture the versions and mode from the machine that produces the unexpected image. An old driver can create behavior that looks like display scaling. ChromeDriver’s official release history records the entry “Fixed screenshot size on retina display” for ChromeDriver 78.0.3904.11, a driver release supporting Chrome 78. Treat this as a historical, version-specific clue. Align a compatible driver and browser before diagnosing a modern setup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Dell 27 Monitor S2725QS, 4K UHD IPS, 120Hz, 5ms, FreeSync Premium
  • Improved ComfortView Plus: Reduces harmful blue light emissions to ≤35%, for all-day comfort without sacrificing color accuracy.
  • Refresh rate: A smooth, tear-free experience with AMD FreeSync Premium (refresh rate up to 120Hz) and an ultra-low 0.03ms response time create a captivating experience for work and play.
  • Vivid colors: Immerse yourself in breathtaking 4K visuals with in-plane switching technology. Enjoy vibrant colors with 99% sRGB. The 1500:1 contrast ratio and HDR readiness deliver excellent depth and detail.
  • Re-engineered sound quality: Enjoy more detailed sound with spacious audio featuring greater output power, deeper frequency response and more decibel range than the previous generation.
  • Ultra-thin bezel: Designed with a sleek, modern aesthetic and an ash white finish, this display features ultra-thin bezels for a refined, minimalist design.

Use your package manager or Selenium’s capabilities to record:

  • Chrome’s exact version and ChromeDriver’s exact version;
  • Selenium language binding and version;
  • operating system and whether the session is headed or headless;
  • local versus CI execution, including the CI display or virtual display configuration.

ChromeDriver’s release history is the authoritative place to check older driver notes. Do not assume that a current browser has the same defect or that one launch argument fixes all platforms.

Measure the browser, page, and file

Read back the WebDriver rectangle

Set a known window size, then read the actual rectangle instead of trusting the requested value. Selenium documents window management and notes that screen resolution can affect rendering in its window documentation.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
# Keep this commented while diagnosing headed Retina behavior.
# options.add_argument("--headless=new")

driver = webdriver.Chrome(options=options)
driver.set_window_size(1440, 900)
print("window rectangle:", driver.get_window_rect())
print("inner size:", driver.execute_script(
    "return {width: window.innerWidth, height: window.innerHeight, "
    "dpr: window.devicePixelRatio, outerWidth: window.outerWidth, "
    "outerHeight: window.outerHeight};"
))
driver.get("https://example.com")
driver.save_screenshot("diagnostic.png")
driver.quit()

set_window_size, rectangle methods, and saving the current-window screenshot are documented in Selenium’s Python Chromium WebDriver API. The example intentionally prints both outer and inner dimensions: browser chrome consumes part of the outer rectangle, so neither value alone is the PNG’s guaranteed size.

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.

Inspect CSS dimensions and DPR in the page

Run this after navigation, because a page can change its viewport or enter fullscreen-like behavior after it loads:

Rank #2
Apple Studio Display: Standard Glass, Tilt-Adjustable Stand
  • A SIGHT TO BE BOLD — An immersive 27-inch 5K Retina display, 12MP Center Stage camera with Desk View, advanced mics and speakers, and Thunderbolt 5 ports.* Studio Display is the perfect partner for Mac.
  • WITH FLYING COLORS — 14.7 million pixels, 600 nits of brightness, support for 1 billion colors, and P3 wide color make everything spring to life with spectacular detail.
  • ADVANCED CAMERA AND AUDIO — The 12MP Center Stage camera helps you look sharp in any light and keeps you in frame during video calls. Desk View lets you share your workspace. And a studio-quality three-mic array ensures you come through clearly.
  • SIX-SPEAKER SOUND WITH SPATIAL AUDIO — Four force-cancelling woofers produce bold bass, and two high-performance tweeters deliver accurate mids and crisp highs. And Spatial Audio creates a sophisticated, cinematic soundstage in supported music, video, and games.
  • SUPERPOWER YOUR STUDIO — Two Thunderbolt 5 ports let you connect high-speed accessories, daisy-chain up to four displays, and even fast-charge Mac laptops. And two USB-C ports are perfect for USB peripherals or charging your iPhone.
metrics = driver.execute_script("""
return {
  innerWidth: window.innerWidth,
  innerHeight: window.innerHeight,
  clientWidth: document.documentElement.clientWidth,
  clientHeight: document.documentElement.clientHeight,
  devicePixelRatio: window.devicePixelRatio,
  screenWidth: window.screen.width,
  screenHeight: window.screen.height
};
""")
print(metrics)

Now inspect the file itself. For example, with Pillow:

from PIL import Image

with Image.open("diagnostic.png") as image:
    print("PNG pixels:", image.size)
    print("PNG mode:", image.mode)

Compare the PNG width and height with innerWidth/innerHeight and DPR. If the bitmap is approximately twice each CSS dimension while DPR is approximately 2, you have identified a high-density capture path. If the numbers disagree, investigate window decorations, full-page capture behavior, emulation, or a driver/browser mismatch rather than simply resizing the image.

Check Chrome mobile emulation and device metrics

ChromeDriver supports mobile emulation with individual device metrics, including a pixelRatio value described as the emulated device’s pixel ratio. See the ChromeDriver mobile-emulation documentation. Emulation is relevant only if your test enables it; ordinary desktop sessions should not turn it on just to compensate for a Retina monitor.

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.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_experimental_option("mobileEmulation", {
    "deviceMetrics": {
        "width": 390,
        "height": 844,
        "pixelRatio": 3
    },
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) "
                 "AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 "
                 "Mobile/15E148 Safari/604.1"
})
driver = webdriver.Chrome(options=options)

Remove the emulation block when the test is intended to represent desktop Chrome. When it is intentional, document the selected width, height, and pixelRatio as part of the baseline; changing any of them changes layout and image dimensions.

Choose and apply the right correction

When a historical driver/browser pair is involved

Upgrade or align ChromeDriver and Chrome according to the release history, then rerun the dimension check. Do not mix a newly installed browser with a stale driver binary and infer a scaling problem from the resulting error or screenshot.

Rank #3
Sale
Dell 32 Monitor S3225QS, 4K UHD VA, 120Hz, FreeSync Premium, Eye Comfort
  • Improved ComfortView Plus: Reduces harmful blue light emissions to ≤35%, for all-day comfort without sacrificing color accuracy.
  • Refresh rate: A smooth, tear-free experience with AMD FreeSync Premium (refresh rate up to 120Hz) and an ultra-low 0.03ms response time create a captivating experience for work and play.
  • Vivid colors: Immerse yourself in 4K visuals with a VA panel. Enjoy true-to-life colors with 99% sRGB and 95% DCI-P3 coverage. The 1500:1 contrast ratio and HDR readiness deliver excellent depth and detail.
  • Re-engineered sound quality: Enjoy more detailed sound with spacious audio featuring greater output power, deeper frequency response and more decibel range than the previous generation.
  • Ultra-thin bezel: Designed with a sleek, modern aesthetic and an ash white finish, this display features ultra-thin bezels for a refined, minimalist design.

When you need CSS-pixel-sized baselines

  1. Use a fixed WebDriver window size and read back the rectangle.
  2. Run with the same headed/headless mode in development and CI.
  3. Disable unintended mobile emulation and verify DPR.
  4. Capture a screenshot and assert its actual dimensions rather than assuming they equal the requested window size.

A dimension assertion turns a silent Retina change into a visible test failure:

from PIL import Image

expected = (1440, 900)  # Replace with the dimensions your capture contract requires.
driver.save_screenshot("page.png")
with Image.open("page.png") as image:
    if image.size != expected:
        raise AssertionError(f"expected {expected}, got {image.size}")

Use the measured viewport, not an arbitrary number, when browser chrome or a headless mode makes the screenshot’s contract different from the outer window.

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

When you need Retina/high-density output

Keep the high-density configuration and make it part of the specification: browser and driver versions, viewport, DPR, headed/headless mode, fonts, operating system, and CI display setup. Store baselines generated under that same contract. Downsampling can make files match a CSS-pixel comparison, but it discards device-pixel detail and can hide a real rendering change; it is a policy choice, not a universal repair.

Make captures reproducible in CI

  • Pin the browser and driver: record exact versions and update them together.
  • Pin geometry: set the window, verify the rectangle, and log viewport metrics.
  • Pin rendering inputs: use the same fonts, operating system image, color scheme, timezone, and locale where visual diffs matter.
  • Pin execution mode: headed and headless sessions can have different geometry and rendering paths.
  • Pin emulation: either remove it or record every device metric, especially pixelRatio.
  • Validate artifacts: assert width and height, and retain the metrics log beside failed images.

WebDriver sizing alone cannot guarantee identical pixels across platforms. A stable visual baseline is a complete environment contract, not just a call to set_window_size.

Troubleshooting common symptoms

The PNG is exactly twice the CSS width and height

Check DPR first. A DPR near 2 with a two-times bitmap is consistent with high-density output. Decide whether that output is desired, then standardize the environment or assert a high-density baseline.

Rank #4
Sale
ASUS ProArt PA32QCV 32 Inch 6K DCI-P3 Thunderbolt 4 Monitor for Mac
  • High-Resolution 6K Display: 31.5-inch 6K (6016 x 3384) LuxPixel AGLR display with IPS 178 wide viewing angle panel
  • Wide Color Gamut Coverage: International color standard 98% DCI-P3 and 100% sRGB wide color gamut for accurate color reproduction
  • Factory Calibrated Color Accuracy: Calman Verified with factory calibration delivering excellent Delta E < 2 color accuracy
  • Versatile Connectivity Options: Rich connectivity including dual Thunderbolt 4 up to 96W Power Delivery with daisy-chaining, HDMI(v2.1), DisplayPort1.4 and a built-in USB Hub
  • MacBook Color Matching: The new M Model-P3 Color Preset Mode matches the color performance of MacBook display for seamless workflow

Changing the window size has no effect

Print get_window_rect() and the JavaScript metrics after navigation. A window manager, a headless mode, mobile emulation, or a page that changes viewport behavior may be overriding the requested geometry. Fix the first value that differs from your contract.

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

DPR is unexpected

Search Chrome options and capabilities for mobile emulation and device metrics. Remove accidental emulation, or set an explicit, documented pixelRatio for an emulated device. Do not infer desktop Retina behavior from a mobile profile.

Local captures pass but CI captures fail

Compare browser/driver versions, headed versus headless mode, virtual display resolution, fonts, and OS image. Log all metrics from both environments and make the CI image the source of truth for its baselines.

Updating ChromeDriver does not solve it

The 78.0.3904.11 note is historical. If versions are already aligned, inspect DPR, emulation, viewport, and PNG dimensions. The available documentation does not establish one universal current launch flag for every Chrome version and platform, so label any flag recipe with the exact environment in which it was verified.

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 a URL-only capture, ScreenshotNeo is a website screenshot API and MCP server. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

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

One request returns PNG, JPEG, WebP, or PDF. The API supports full-page captures with lazy images, CSS-selector element captures, dark mode, device presets or custom viewports, Retina scale, PDF paper and page settings, custom CSS and JavaScript, clicks, selector/delay/network-idle waits, request and resource blocking, headers/cookies/user agents/Authorization, timezone and geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed image links, asynchronous signed webhooks, up to 100 URLs per bulk call, a usage API, and an OpenAPI specification. Common parameter names used by other screenshot APIs are accepted to ease migration.

Best Value
Apple Studio Display: Nano-Texture Glass, Tilt-Adjustable Stand
  • A SIGHT TO BE BOLD — An immersive 27-inch 5K Retina display, 12MP Center Stage camera with Desk View, advanced mics and speakers, and Thunderbolt 5 ports.* Studio Display is the perfect partner for Mac.
  • WITH FLYING COLORS — 14.7 million pixels, 600 nits of brightness, support for 1 billion colors, and P3 wide color make everything spring to life with spectacular detail.
  • ADVANCED CAMERA AND AUDIO — The 12MP Center Stage camera helps you look sharp in any light and keeps you in frame during video calls. Desk View lets you share your workspace. And a studio-quality three-mic array ensures you come through clearly.
  • SIX-SPEAKER SOUND WITH SPATIAL AUDIO — Four force-cancelling woofers produce bold bass, and two high-performance tweeters deliver accurate mids and crisp highs. And Spatial Audio creates a sophisticated, cinematic soundstage in supported music, video, and games.
  • SUPERPOWER YOUR STUDIO — Two Thunderbolt 5 ports let you connect high-speed accessories, daisy-chain up to four displays, and even fast-charge Mac laptops. And two USB-C ports are perfect for USB peripherals or charging your iPhone.
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 ScreenshotNeo documentation for parameters and response handling. The same request in Python and Node.js:

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)
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(`HTTP ${res.status}`);
require('fs').writeFileSync('shot.webp', Buffer.from(await res.arrayBuffer()));

The Free plan includes 1,000 shots per month with no card. Paid plans are Starter $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000, and Business $249 for 1,000,000; yearly billing gives two months free, and every feature is on every plan. Create a free ScreenshotNeo account to start with the 1,000-shot allowance.

FAQ

Is a two-times PNG necessarily wrong?

No. It is expected when the capture contract calls for device-pixel detail and the effective DPR is about 2. It is wrong only when your test requires CSS-pixel dimensions.

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

Should I always add a device-scale-factor launch flag?

No universal flag combination is established for all current Chrome versions and platform modes. Verify the actual dimensions and DPR in the environment you ship.

Can one baseline serve every operating system?

Not reliably. Fonts, rasterization, browser mode, display configuration, and versions can alter pixels even with the same CSS viewport. Use a controlled rendering environment for strict image comparisons.

Frequently Asked Questions

Is a two-times PNG necessarily wrong?

No. It is expected when the capture contract calls for device-pixel detail and the effective DPR is about 2. It is wrong only when your test requires CSS-pixel dimensions.

Should I always add a device-scale-factor launch flag?

No universal flag combination is established for all current Chrome versions and platform modes. Verify the actual dimensions and DPR in the environment you ship.

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

Can one baseline serve every operating system?

Not reliably. Fonts, rasterization, browser mode, display configuration, and versions can alter pixels even with the same CSS viewport. Use a controlled rendering environment for strict image comparisons.

Quick Recap

Bestseller No. 2
Apple Studio Display: Standard Glass, Tilt-Adjustable Stand
Apple Studio Display: Standard Glass, Tilt-Adjustable Stand
Screen size is measured diagonally.; Tilt- and height-adjustable stand and VESA mount adapter sold separately.
$1,599.00
Bestseller No. 5
Apple Studio Display: Nano-Texture Glass, Tilt-Adjustable Stand
Apple Studio Display: Nano-Texture Glass, Tilt-Adjustable Stand
Screen size is measured diagonally.; Tilt- and height-adjustable stand and VESA mount adapter sold separately.
$1,859.99

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.