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

Use Playwright’s scale: "device" option to preserve device pixels, and set the browser context’s deviceScaleFactor and CSS viewport explicitly. A viewport of 1280×800 with a device scale factor of 2 produces a capture with roughly twice as many pixels in each dimension (subject to page and browser rendering). Choose fullPage, clip, or a locator screenshot independently to control which part of the page is included.

This guide shows reproducible JavaScript, Python, and command-line workflows, explains the difference between CSS pixels and device pixels, and covers full-page, element, region, file, and in-memory captures.

What “high resolution” means in Playwright

Playwright separates layout size from output pixel density. The viewport sets the page’s CSS layout dimensions. The context’s deviceScaleFactor emulates the device pixel ratio. The screenshot option scale: "device" writes one image pixel for each device pixel; on a high-DPI context, that can make the image substantially larger than the CSS viewport.

Use scale: "css" when you deliberately want one output pixel per CSS pixel and smaller files. Playwright’s page screenshot reference documents "device" as its default, while screenshot assertions use a different default in the testing API. Specify the value explicitly whenever captures are compared or processed so that a change of API path cannot silently alter dimensions. See the Page API reference and parameter documentation.

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.

Device pixels versus CSS pixels

  • CSS viewport: the logical layout, such as 1280×800.
  • Device scale factor: the emulated ratio between device and CSS pixels, such as 2.
  • Screenshot scale: whether output follows device pixels ("device") or CSS pixels ("css").

Changing the scale does not redesign the page or make text sharper through interpolation. It changes how rendered pixels are represented in the output. State both viewport and scale in your capture recipe so another developer can reproduce it.

Set up a reproducible high-resolution capture

JavaScript example

Install Playwright and its browser binaries, then run this script. The device scale factor of 2 is an example, not a universal recommendation; choose the value that matches the device or visual test you are emulating.

import { chromium } from 'playwright';

const browser = await chromium.launch();
const context = await browser.newContext({
  viewport: { width: 1280, height: 800 },
  deviceScaleFactor: 2,
});
const page = await context.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({
  path: 'capture.png',
  scale: 'device',
});
await browser.close();

networkidle is useful for pages that finish loading their requests, but it is not a guarantee that every animation, web font, or lazy image has settled. Add an explicit wait for the page state your capture requires.

Python example

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()
    context = browser.new_context(
        viewport={"width": 1280, "height": 800},
        device_scale_factor=2,
    )
    page = context.new_page()
    page.goto("https://example.com", wait_until="networkidle")
    page.screenshot(path="capture.png", scale="device")
    browser.close()

Python exposes the same controls with snake_case for context settings and the same screenshot scale values.

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

Choosing a browser and context

Create a fresh context for each emulated device or test case. This keeps viewport, scale factor, cookies, and other state isolated. The emulation guide documents device-related context settings.

Choose the capture area

Resolution and scope are separate decisions. A device-pixel full-page image can be extremely tall; a high-resolution element capture may be the better artifact for visual review or image processing.

Rank #2
Sale
LG 27US500-W Ultrafine Monitor 27-Inch 4K UHD (3840x2160) HDR10 IPS Borderless Design Reader Mode Flicker Safe Switch App HDMI DisplayPort - White
  • 4K UHD with 1000:1 Contrast Ratio - This UltraFine display with a 1000:1 contrast ratio displays deeper blacks and vivid colors in UHD clarity. With wide viewing angles, it gives creative professionals the ability to view and work with highly-detailed, digital imagery.
  • 4K HDR10 DCI-P3 - Explore HDR10 content the way it was meant to be seen with up to 90% DCI-P3 color gamut expression—an elevated color spectrum that brings brilliant color to life.
  • Onscreen Control - You can customize the workspace by splitting the display or adjusting basic monitor options with just a few mouse clicks.
  • Ergonomic Stand - The ergonomic stand makes it easy to flexibly adjust the tilt of the screen in the optimal position for you.
  • What's In The Box - Stand Body, Stand Base, Screws, Power Adapter, HDMI Cable, Quick Start Guide, Registration Card, Warranty.
Goal Playwright option Result
Visible screen page.screenshot() The current viewport only.
Entire scrollable document fullPage: true A page-length image, rendered at the selected scale.
Fixed rectangle clip: { x, y, width, height } A bounded region in CSS-coordinate space.
One component locator.screenshot() The element’s rendered bounds.

Full-page screenshot

await page.screenshot({
  path: 'full-page@2x.png',
  fullPage: true,
  scale: 'device',
});

fullPage captures the full scrollable page; it does not set pixel density. Keep scale: "device" explicit if the image must retain device pixels.

Clip a region

await page.screenshot({
  path: 'hero-region.png',
  clip: { x: 40, y: 120, width: 1200, height: 500 },
  scale: 'device',
});

The clip rectangle uses page coordinates and CSS dimensions. Make sure the rectangle lies within the rendered page and is large enough for the content you need.

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

Capture a locator

const card = page.locator('[data-testid="pricing-card"]').first();
await card.screenshot({
  path: 'pricing-card.png',
  scale: 'device',
});

Locator screenshots avoid hard-coding coordinates and automatically target the element’s bounds. If the selector matches multiple nodes, use first() or a more specific locator.

Save a file or process the image in memory

Providing path writes an image artifact. Omitting it returns screenshot bytes, which is useful for hashing, uploading, OCR, or other processing.

const bytes = await page.screenshot({ scale: 'device' });
await processImage(bytes);

Choose an output format with the documented screenshot options (for example, PNG or JPEG quality settings) when your pipeline needs a particular file type. Keep lossless PNG for pixel comparisons; use a lossy format only when smaller files are more important than exact pixel values.

Make high-resolution captures stable

Wait for meaningful page state

  • Navigate with an appropriate waitUntil condition.
  • Wait for a key selector: await page.locator('[data-ready="true"]').waitFor().
  • Wait for web fonts when typography matters: await page.evaluate(() => document.fonts.ready).
  • Disable or pause animations in a test-only stylesheet if motion causes inconsistent frames.
  • Scroll or interact with the page before capture when lazy-loaded content depends on those actions.

Control the rendering environment

Use the same browser engine, viewport, device scale factor, color scheme, locale, and timezone for every comparison. Differences in fonts, operating-system rendering, or browser versions can change pixels even when your code is unchanged. A high scale factor increases memory use and file size; it does not remove those environmental differences.

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.
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.

Lazy content and full-page captures

Some sites load images only after they approach the viewport. A full-page screenshot may therefore contain placeholders unless the page’s lazy-loading behavior is triggered or the application provides a ready signal. Wait for the relevant images or application state rather than assuming that network idle means every below-the-fold asset is visible.

Common problems and fixes

The image is still the “wrong” size

Check both dimensions. The CSS viewport is not the output size when scale: "device" is used. Confirm the context’s deviceScaleFactor, the viewport, and whether you are using full-page or a clip. Also check that a different code path, such as a test assertion, has not selected a different scale default.

Text or images look soft

Use scale: "device" and an appropriate device scale factor. Do not enlarge a finished CSS-scale bitmap and expect new detail; capture at the required pixel density from the browser.

Full-page output is unexpectedly huge

Full-page scope and device scale multiply the amount of rendered data. Capture a locator or clip when you need only a component, or use scale: "css" when device-pixel detail is not required. Break very long documents into logical regions if downstream tools cannot handle a single tall image.

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

The element screenshot fails or is blank

Verify the locator resolves to one visible element, wait for it to appear, and ensure it is not covered by a modal or still transitioning. For a cross-origin frame, locate the frame first and then query inside it. A navigation, redirect, or closed page can also invalidate a previously obtained locator.

Images or fonts are missing

Wait for the application’s ready condition and for critical resources. If a page requires authentication, establish the context state before navigation. For lazy assets, scroll them into view or use the application’s own preload mechanism before taking the screenshot.

Rank #4
Samsung 27" Odyssey G5 (G51F) Series QHD (1440P) Gaming Monitor
  • QHD Resolution (2560 x 1440) has 1.7 times the pixel density of Full HD for incredibly detailed pinsharp images
  • HDR10 provides brighter highlights and nuanced shadow for added depth - making every scene feel more vivid and realistic
  • The 180Hz refresh rate minimizes lag for gameplay with ultra-smooth action. Plus, the 1ms response time helps capture your moves in real-time, allowing you to react fast for gaming precision
  • AMD FreeSync reduces choppiness, screen lag and image tearing, ensuring that your fast-paced, complex in-game action is stable with minimal stutter
  • Ergonomic stand allows for tilt, pivot and height adjustments to maximize gaming comfort

Captures differ between machines

Pin browser versions where practical, use identical context settings, install the same fonts, and avoid time-dependent content. Record the URL, viewport, scale factor, browser engine, and capture timestamp with each artifact so a mismatch can be diagnosed.

The process runs out of memory

Reduce scope, lower the device scale factor, capture components separately, and close contexts promptly. Avoid retaining many high-resolution buffers at once; stream or process each result before starting the next capture.

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

Performance, reliability, and cost considerations

Higher pixel density increases encoding work, transfer size, and memory pressure. Full-page captures add document height to that cost. Locator and clipped captures are usually more efficient when the review target is a component. For repeatable pipelines, reuse a browser process but isolate jobs in contexts, set navigation and selector timeouts explicitly, and retry only failures that are safe to repeat.

Playwright itself does not provide a measured quality or speed guarantee for a particular scale factor. Treat deviceScaleFactor: 2 as a configuration choice, then measure your own page, image dimensions, and processing time. Keep the capture settings in source control alongside visual baselines.

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

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF. It accepts cookie and consent banners like a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status.

For a direct image request, see the ScreenshotNeo documentation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

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)

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}`);

ScreenshotNeo also supports full-page capture with lazy images loaded, CSS-selector element captures, dark mode, 12 device presets plus custom viewports, retina scale, PDF paper and page-range controls, custom CSS and JavaScript, pre-capture clicks, selector waits, delays, network-idle waits, request and resource blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Its parameter names are compatible with those used by other screenshot APIs, which can simplify migration.

Best Value
Dell 27 Monitor S2725QC, 4K UHD IPS, 120Hz, 99% sRGB, 4ms, FreeSync Premium
  • Low blue light: The 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.
  • Easy connectivity: Keep your desk organized and clutter-free with a single USB-C cable (up to 65W power delivery).

An MCP server supplies take_screenshot, get_page_info, and capture_pdf tools to Claude, Cursor, and other MCP clients, so an AI agent can capture pages without you wiring a browser runtime into the agent.

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

Yearly billing gives two months free, and every feature is available on every plan. Start with 1,000 free screenshots a month with no card; paid plans start at $5 for 3,000.

FAQ

Does a higher device scale factor change responsive breakpoints?

No. Breakpoints are driven primarily by the CSS viewport. The scale factor changes device-pixel density; keep the viewport fixed when comparing responsive layouts.

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.

Should visual regression tests use device or CSS scale?

Either can be valid. Use device scale when the baseline must represent device pixels; use CSS scale for smaller, layout-focused baselines. The important requirement is to set the choice explicitly and keep it constant.

Can a locator screenshot replace a full-page screenshot?

Only when the component is the artifact you need. A locator capture does not document content elsewhere on the page; choose full-page scope for document-level review.

Frequently Asked Questions

What is the simplest high-resolution Playwright setting?

Set an explicit context viewport and deviceScaleFactor, then call page.screenshot({ scale: ‘device’ }).

Why are my screenshots different after a browser upgrade?

Browser and font rendering can change pixels. Pin the browser version where possible and keep viewport, scale, fonts, locale, and timing conditions consistent.

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

Is fullPage required for a high-resolution screenshot?

No. High resolution is controlled by scale and device settings; fullPage only changes the captured 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.