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

For a sharper, device-pixel-resolution Playwright image, set scale: "device" on page.screenshot(). For an image sized to the page’s CSS pixels, use scale: "css". The right setting depends on the output you need: device scaling can produce an image twice as large or larger, while CSS scaling keeps it at one output pixel per CSS pixel. Changing scale is a useful first check, not a universal sharpening fix.

Choose the screenshot scale for the output you need

Playwright’s screenshot scale option controls how page pixels map to output pixels. It does not apply a sharpening filter or change the page’s CSS layout.

Setting Pixel mapping Use it when
"device" One output pixel per device pixel You need a higher-resolution image for review or another device-pixel-resolution use. The resulting image can be twice as large or larger than a CSS-scale image on a high-DPI display.
"css" One output pixel per CSS pixel You want a more compact image at the page’s CSS layout resolution.

These mappings and the possibility of larger output dimensions are documented in the Playwright Page API. The default for page.screenshot() is "device", but specifying the setting explicitly makes your intent clear and avoids relying on a default.

Set the scale on a direct page screenshot

Use "device" for device-pixel-resolution output:

await page.screenshot({ path: 'screenshot.png', scale: 'device' });

Choose "css" when you want one output pixel per CSS pixel instead:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
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.
await page.screenshot({ path: 'screenshot.png', scale: 'css' });

These examples assume page is an initialized Playwright page. The option controls screenshot output resolution; it does not by itself guarantee that text, images, or other page content will look sharp in every situation.

Match the scale when using screenshot assertions

Direct screenshots and Playwright Test visual assertions have different documented defaults: page.screenshot() defaults to "device", while toHaveScreenshot() defaults to "css". If you are comparing a saved screenshot with an assertion baseline, set the intended scale explicitly so the two paths use the same pixel mapping. See the PageAssertions API for assertion options.

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.

For visual regression tests, keep the environment used to generate and compare baselines consistent. Playwright notes that rendering can vary with the host operating system, browser version, settings, hardware, power source, and headless mode. Its guidance is to generate and compare baselines in the same environment; see Visual comparisons.

Diagnose blur that remains after setting the scale

If the screenshot still looks blurry, do not assume scale is the only factor. The scale option defines output pixel mapping, but it cannot add detail that was not rendered or present in the source content.

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
LG 32UR550K-B 32-inch Ultrafine 4K UHD (3840 x 2160) Computer Monitor, HDR10, 60Hz, HDMI, DisplayPort, Tilt/Height/Pivot Adjustable Stand, Black
  • Master Every Pixel - Bring every detail to life with LG’s UltraFine 32” 4K UHD HDR display. Whether you’re editing, streaming, or multitasking, the expansive screen and rich color deliver clarity you can count on.
  • Color Your World in 4K and HDR Content - Stream in stunning detail with the LG UltraFine 4K display. HDR technology delivers vibrant brightness and rich contrast, supporting up to 90% of the DCI-P3 color space for vivid, lifelike visuals that elevate every scene.
  • Immersive Visuals for Tactical Edge - Game in crisp 4K UHD with rich visuals and immersive audio powered by Waves MaxxAudio. With gaming features such as Dynamic Action Sync and Black Stabilizer, you’ll react faster and spot enemies in the shadows—so you’re always one step ahead.
  • Dynamic Action Sync - Don’t miss a beat. Dynamic Action Sync helps you spot the action and strike fast by reducing input lag and boosting responsiveness.
  • Never in the Dark with Black Stabilzer - Never get caught off guard. Black Stabilizer enhances visibility in low-light scenes so you can spot threats before they see you.
  • Check the actual output dimensions. Confirm whether the saved image is at device-pixel or CSS-pixel resolution, and whether that matches how you plan to view or use it.
  • Check source content. A low-resolution image asset may still look soft in a higher-resolution screenshot; changing screenshot scale does not increase the asset’s original detail.
  • Check how you are comparing images. Ensure a direct screenshot and a visual assertion use the same explicit scale before investigating other differences.
  • Check environment consistency. For regression comparisons, capture and compare on the same operating system, browser version, settings, hardware, power conditions, and headless mode where possible.

The Playwright documentation establishes the scale mappings and warns about environment-dependent visual rendering; it does not establish that scale explains every blurry screenshot.

Or skip the browser setup

If you need a screenshot through an API instead of configuring a Playwright browser, ScreenshotNeo takes a URL in one GET request and returns a screenshot or PDF. Its clean-shot steps can accept cookie or consent banners and remove known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. An MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000.

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 API documentation for request options. ScreenshotNeo is a website screenshot API and MCP server by Yorker Media; the API’s pixel dimensions and rendering are a separate choice from Playwright’s scale option.

Rank #4
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.

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

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

Frequently Asked Questions

Does scale: "device" always make a screenshot sharper?

No. It maps output pixels to device pixels, but it cannot restore detail missing from source assets or guarantee that every rendering issue is fixed.

Best Value
Sale
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).

Should visual regression tests use device or CSS scale?

Choose the mapping that fits the test, apply it consistently, and generate and compare baselines in the same rendering environment.

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.