October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Capture a Website Screenshot with a Custom Device Scale Factor

Set the browser’s emulated device scale factor separately from screenshot output scale. Includes Playwright and CDP examples, capture options, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the browser’s emulated deviceScaleFactor on its context, then choose the screenshot’s output scale separately. In Playwright, those controls determine, respectively, the device-pixel ratio the page runs under and whether the saved image uses CSS-pixel or device-pixel density.

What device scale factor changes

A device scale factor (often called device-pixel ratio) describes how browser CSS pixels map to device pixels in the emulated environment. Set it when you need the page to behave as though it is running on a particular pixel-density display. It is not the same as asking the screenshot API to write a denser image.

As an Amazon Associate I earn from qualifying purchases.

Playwright exposes these as two independent settings:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • deviceScaleFactor is a browser-context option that configures the emulated device scale factor. Playwright documents its default as 1 (BrowserType.newContext documentation).
  • Screenshot scale controls output density: css produces one image pixel per CSS pixel; device produces one image pixel per device pixel (Page.screenshot documentation).

For reproducible captures, record both values along with the viewport dimensions, browser/framework version, image format, and whether you captured the viewport, an element, or the full page.

#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works

Capture a screenshot with Playwright

This JavaScript example sets a 1280-by-800 CSS-pixel viewport and emulates a device scale factor of 2. It then asks the screenshot API to output at device-pixel density. The factor and output scale are deliberately specified separately.

const { chromium } = require('playwright');

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

Install Playwright and its browser binaries for your project before running the script. Replace the example URL as needed. The dimensions supplied to viewport are CSS pixels; the device factor sets the emulated pixel ratio. To save one image pixel per CSS pixel instead, use scale: 'css'.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Choose the capture area

By default, page.screenshot() captures the viewport. Playwright also supports full-page capture and capture of a selected element. Full-page capture cannot be combined with a target element in the documented screenshot tool; choose one capture mode at a time (Page.screenshot documentation).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
// Full scrollable page
await page.screenshot({ path: 'full-page.png', fullPage: true, scale: 'device' });

// One element
await page.locator('main').screenshot({ path: 'main.png', scale: 'device' });

For a fair comparison across runs, keep the capture area and viewport fixed. Full-page output dimensions can differ from viewport screenshots because the full scrollable page is captured.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Use Chrome DevTools Protocol directly

If your automation speaks the Chrome DevTools Protocol (CDP), apply the device metrics override before requesting the screenshot. Set the viewport dimensions, mobile emulation flag, and desired scale factor in Emulation.setDeviceMetricsOverride; then call Page.captureScreenshot. The protocol reference states: “Overriding device scale factor value. 0 disables the override.” (Emulation.setDeviceMetricsOverride; Page.captureScreenshot).

For example, the Chrome protocol overview shows a factor of 2.625 before a screenshot request. That is a documentation example, not a recommended setting for every device (Chrome DevTools Protocol overview). CDP is lower-level than Playwright: your client must establish and manage the protocol session and target page.

Rank #4
NIVEOLI Webcam 1080P with Microphone & Privacy Cover for PC/Laptop, USB Computer Camera Plug & Play with Auto Light Correction for Video Calls, Live Streaming Gaming & Online Meetings
  • 【Crystal-Clear 1080P HD Video】This 1080p webcam for PC delivers sharp, true Full HD video at 30 frames per second, bringing your digital world to life with vibrant clarity. Enjoy smooth, real-time streaming with enhanced high dynamic range (HDR) that keeps your face clearly visible even in low light or backlit conditions.
  • 【Built-In Noise-Canceling Microphone】This computer camera with microphone features dual noise-reducing digital mics and an advanced audio processor, capturing rich stereo sound while filtering background noise. It ensures clear conversations during video calls, even in busy environments.
  • 【Privacy Shutter for Added Security】This secure USB webcam includes a built-in privacy cover, letting you physically block the lens with a simple slide. Protect your visibility and keep the lens dust-free—no drivers needed, just plug into USB 2.0 and start using it immediately.
  • 【Flexible Mount & Auto Light Correction】Designed for your computer or laptop, this webcam comes with an adjustable clip for monitors or standalone use. It offers automatic light correction and fixed focus for sharp, well-balanced images in any lighting.
  • 【Wide Device & Platform Compatibility】This versatile webcam for laptop and desktop use is compatible with Windows, Mac, Linux, and Android systems. Supports Skype, Zoom, Twitch, YouTube, and more—featuring a 360° rotating head for easy adjustment. Simply plug and play.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use Puppeteer or another browser automation library

Puppeteer documents page screenshots through Page.screenshot() and element screenshots through ElementHandle.screenshot() (Puppeteer screenshot guide). Device-scale configuration is an emulation/context concern; its exact API can vary by Puppeteer release, so check the reference matching the version installed in your project. Do not assume a screenshot method’s output scale option changes the page’s emulated device-pixel ratio.

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

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its one-call API can return an image or PDF; the API accepts screenshot parameters, including familiar names used by other screenshot APIs, to make switching easier. See the ScreenshotNeo API documentation.

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 and 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/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server includes 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 screenshots. Sign up for 1,000 free screenshots a month, with no card required.

Troubleshoot unexpected screenshot dimensions

  • The image is larger than expected: Check both the context’s deviceScaleFactor and screenshot scale. With scale: 'device', output uses device pixels; use scale: 'css' if you want one output pixel per CSS pixel.
  • The page layout did not change: Confirm that deviceScaleFactor was set on the context before creating or navigating the page. A screenshot output scale is not a replacement for device emulation.
  • A CDP capture ignores the factor: Apply Emulation.setDeviceMetricsOverride to the intended target before calling Page.captureScreenshot. A factor of zero disables the scale override.
  • Results differ between runs: Compare the browser/framework version, viewport width and height, device scale factor, screenshot output scale and format, and capture mode. Also ensure the page has reached the same state before capture.
  • Puppeteer rejects an emulation option: Check the API reference for the installed Puppeteer release; the precise device-scale setup is version-dependent.

FAQ

Is deviceScaleFactor the same as screenshot scale?

No. The former configures the browser’s emulated device-pixel ratio; screenshot scale chooses whether image pixels correspond to CSS pixels or device pixels.

What happens if I leave Playwright’s deviceScaleFactor unset?

Playwright documents the default as 1.

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.