October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober 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

Puppeteer Screenshots with deviceScaleFactor: High-Resolution Output

Configure Puppeteer’s deviceScaleFactor before navigation, then choose the capture extent and output format with screenshot options.

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.

Set deviceScaleFactor in page.setViewport() before navigating, then capture the page with page.screenshot(). For example, a 1280 × 800 CSS-pixel viewport at scale factor 2 requests a high-resolution screenshot:

await page.setViewport({ width: 1280, height: 800, deviceScaleFactor: 2 });
await page.goto(url);
await page.screenshot({ path: 'page.png', fullPage: true });

The viewport sets the page’s emulated display metrics; screenshot options separately determine the captured area and output format. Puppeteer’s current documentation identifies version 25.12.0 on the relevant reference pages. Viewport configuration · Screenshot guide

As an Amazon Associate I earn from qualifying purchases.

Complete Puppeteer example

This example uses Puppeteer’s JavaScript API. Replace the URL with the page you want to capture. It writes a full-page PNG with an emulated viewport 1280 CSS pixels wide and 800 CSS pixels high, using a device scale factor of 2.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();

    await page.setViewport({
      width: 1280,
      height: 800,
      deviceScaleFactor: 2,
    });

    await page.goto('https://example.com', { waitUntil: 'networkidle0' });
    await page.screenshot({ path: 'page.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

Set the viewport before navigation when possible. Puppeteer recommends this ordering for sites that react to viewport changes; changing viewport characteristics can reload a page in some cases. See Page.setViewport().

#1 Best Overall
Sale
Dell 27 Monitor S2725QS, 4K UHD IPS, 120Hz, 5ms, FreeSync Premium | 350 cd/m2 Brightness, 1,500:1 Contrast, 99% sRGB, Anti-Glare, HDMI, DisplayPort, USB‑C, Height Adjustable, Swivel, Pivot
  • 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.

What deviceScaleFactor changes

width and height describe the emulated viewport in CSS pixels. deviceScaleFactor sets the emulated device-pixel ratio used when rendering. A factor greater than 1 requests more device pixels for the same CSS-sized viewport, which is useful when an image needs finer detail. It does not change the CSS dimensions you set for the page.

The documentation describes the setting and API behavior, but does not establish a universal output-dimension guarantee, quality improvement, memory cost, or runtime for every page and configuration. Check the resulting image and the target application when exact rendering matters.

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.

Choose what to capture and how to encode it

Viewport configuration and capture selection are separate. Set page metrics with setViewport(), then choose the capture extent and format in the screenshot call. Puppeteer documents these screenshot options in its ScreenshotOptions reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Goal Screenshot configuration What it does
Capture the visible viewport page.screenshot({ path: 'view.png' }) Captures the viewport; fullPage defaults to false.
Capture the full page page.screenshot({ path: 'full.png', fullPage: true }) Captures the full page rather than only the viewport.
Capture a rectangular region page.screenshot({ path: 'region.png', clip: { x: 0, y: 0, width: 600, height: 400 } }) Captures the selected rectangle.
Capture one element await (await page.$('.target')).screenshot({ path: 'element.png' }) Uses ElementHandle.screenshot() for a particular page element.

The screenshot type can be inferred from the file extension, or you can set the type option explicitly. The quality option does not apply to PNG. For transparency, use omitBackground: true where appropriate.

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.

Viewport emulation is not headless screen configuration

page.setViewport() controls the metrics of a page’s emulated viewport, including its device scale factor. Puppeteer’s screen configuration guide covers configuring the headless browser’s available screen separately. Use viewport settings when the page layout or screenshot’s device-pixel ratio is the concern; screen configuration is a distinct browser-display concern.

Common problems and fixes

  • The image is not the size you expected: distinguish CSS viewport dimensions from device-pixel dimensions, and confirm whether you captured the viewport, the full page, or a clipped rectangle. Inspect the actual output rather than assuming a universal dimension rule.
  • The page layout differs from the intended viewport: set width, height, and scale factor before goto(). Some sites react to viewport changes, and Puppeteer notes that certain changes can reload the page.
  • The image includes only the visible area: add fullPage: true for a full-page capture, or use clip for a defined region.
  • PNG quality has no effect: the screenshot quality option is not applicable to PNG. Select an appropriate output type if you need an encoding quality setting.
  • An element screenshot fails: make sure the selector resolves to an element before calling its screenshot method; use ElementHandle.screenshot() for element capture as documented in the screenshot guide.

Or skip the browser setup

If you need a screenshot without launching and configuring Puppeteer yourself, ScreenshotNeo takes a URL in one API request. Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides screenshot tools for AI agents, and the service includes PNG, JPEG, WebP, and PDF output options.

Example cURL request (see the 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

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Dell 32 Monitor S3225QS, 4K UHD VA, 120Hz, FreeSync Premium, Eye Comfort | 3840x2160, 31.5in, 3000:1 Contrast, 300 cd/m2 Brightness, 4ms, 99% sRGB, Anti-Glare, HDMI, DisplayPort
  • 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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

Does deviceScaleFactor belong in page.screenshot()?

No. Set it in the viewport configuration with page.setViewport(); page.screenshot() handles the capture.

Can I use deviceScaleFactor with a full-page capture?

Yes. Configure the viewport first and set fullPage: true in the screenshot options.

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

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.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.