Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

Fix Screenshot API Captures With Incorrect Viewport Dimensions

A screenshot larger or smaller than its configured viewport may reflect pixel scaling or capture-region settings—not an API bug. Check the effective viewport, emulation and screenshot options.

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.

If a screenshot’s pixel dimensions do not match the viewport you configured, first check whether you are comparing CSS pixels with device pixels. Then verify the active viewport, device-emulation settings, and capture region. A larger image may be correctly scaled, full-page, clipped, or captured from an element—not evidence by itself of an API defect.

First identify which dimensions do not match

Write down the intended viewport width and height in CSS pixels, then inspect the returned file’s width and height in image pixels. These are not necessarily the same units. Also identify the region you asked the screenshot tool to capture.

What you expected What to check first
Image dimensions equal the configured viewport Screenshot scale and device scale factor
Image height equals the visible browser area Full-page capture
Image is unexpectedly cropped or has custom dimensions Clip rectangle or element-target capture
Page layout itself uses the wrong responsive breakpoint Effective viewport and screen configuration

For a useful comparison, record five values: CSS viewport, screen size, device scale factor, screenshot scale and output pixel dimensions, plus the capture region (viewport, full page, clip, or element). These settings describe different things.

Check the effective viewport and emulation settings

Set Playwright’s viewport before navigation

Playwright allows viewport configuration when creating a browser context or resizing a page. Its Page documentation says that page.setViewportSize() resizes the page and recommends setting the size before navigation, because many sites are not designed to have their viewport changed after loading. It also notes that this call resets the screen size; if both values matter, configure screen and viewport on the context.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
BenQ GW2790C 27" IPS Computer Montior 1080P FHD 144Hz Game-Ready, Home Office, USB-C, Visual Optimizer, Flicker-Free, Low Blue Light, Ultra Slim Bezel, TUV-Certified, Eye-CareU
  • 【Designed for Comfortable All-Day Productivity】 Enhance your workflow with a 24-inch IPS eye care monitor built for home office, study, and daily tasks, featuring BenQ Eye-Care technologies to reduce eye strain during extended screen time.
  • 【USB-C One-Cable Convenience】 Connect your laptop or MacBook with a single USB-C cable for video, data, and power delivery, reducing cable clutter and simplifying your workspace
  • 【Smooth 144Hz for Better Work Experience】 Enjoy smoother scrolling, reduced motion blur, and more responsive multitasking compared to standard 60Hz monitors—perfect for long work sessions and Gaming!
  • 【Built for Business & Office Deployment】 Designed for corporate offices, remote teams, and large-scale workstation setups. Reliable performance and consistent display quality make it ideal for IT deployment and bulk purchasing
  • 【Energy Efficient & Certified Sustainability】 Reduce energy consumption and lower operating costs—an efficient choice for businesses and users running monitors for extended hours
import { chromium } from 'playwright';

const browser = await chromium.launch();
const context = await browser.newContext({
  viewport: { width: 1280, height: 720 },
  screen: { width: 1280, height: 720 },
});
const page = await context.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'page.png' });
await browser.close();

Use a URL you control or are authorized to capture. If you use page.setViewportSize(), call it before page.goto() where possible.

Check device presets and configuration order

Playwright device emulation includes separate properties such as user agent, screen size, viewport, touch support and device scale factor. A device preset carries its own viewport. If your project configuration spreads a preset, put your intended override after it so the override takes precedence:

import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [{
    use: {
      ...devices['iPhone 13'],
      viewport: { width: 1280, height: 720 },
    },
  }],
});

Choose whether you want the preset’s mobile characteristics or a custom desktop-sized viewport; overriding only the viewport does not necessarily make the other emulated properties desktop-like. See Playwright’s emulation documentation for the distinct settings.

Rank #2
MNN 15.6" FHD 60Hz Portable Monitor USB-C HDMI IPS HDR Gaming Laptop
  • Full HD Portable Monitor - MNN 15.6inch portable laptop monitor with 1920*1080 resolution, advanced IPS glossy screen support 178° full viewing angle, it renders accurate and bright color, draws you into the video or game with lifelike colors and amazing detail.It can effectively reduce blue light radiation damage, no flickering, eye-care, and make it easier to watch for a long time.A second monitor for working from home.
  • Double Type-C Port -For Plug & Play, the MNN monitor provides 2 Full Feature Type-C ports. Only One USB Type-C Cable is required to connect to the power supply & display signal transmission. NOTE: Your device should support thunderbolt 3.0 or USB 3.1 Type C DP ALT-MODE.which supports multiple connect ways to your laptops, PC, Phones, Macbooks, PS5/PS4, Xbox, and Switch.
  • Lightweight Ultra Slim for Travel - As a portable external monitor,MNN portable laptop monitor easily accommodate to every suitcase and backpack and stress-free when you are holding it for a long time. They are truly portable computer monitors for travelers, students, gamers,engineers, and everyone.
  • Give consideration to work and games - through multiple display modes [Copy Mode/Extended Mode/Second Screen Mode/Portrait Mode], we can bring you a clear second screen in the meeting, and expand the screen anytime and anywhere to improve work efficiency and improve the quality of life. Adjusting to HDR mode can upgrade the image to a new level, providing you with brighter highlights,deeper and more realistic colors, more realistic images, and amazing viewing/gaming experience.
  • Powerful Smart Cover - MNN portable external monitor can work in both landscape and portrait mode, can be used as a gaming monitor, screen extender for laptop or phone. Comes with a scratch-proof smart cover made of durable PU leather exterior, doubles as a stand, provides comprehensive protection for this portable computer monitor.

Match screenshot scale to the dimensions you expect

Playwright screenshots support scale: "css", which produces one image pixel per CSS pixel, and scale: "device", which produces one image pixel per device pixel. On a high-DPI configuration, device scale can therefore produce a bitmap larger than the CSS viewport. Don’t apply a universal multiplier without checking the effective device scale factor and actual output.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.screenshot({
  path: 'page.png',
  scale: 'css',
});

If your target is a device-resolution image instead, use scale: "device" and compare the result with the emulated device scale factor. The Playwright screenshot API documents the available screenshot options.

Make sure you are capturing the intended region

Viewport versus full page

In Playwright, fullPage: true captures the full scrollable page rather than only the current viewport. Turn it off if the expected output is limited to the visible viewport:

Rank #3
ViewSonic VA2448-MHU 24 Inch 1080p IPS Computer Monitor, 120Hz, USB C
  • VERSATILE FULL HD IPS DISPLAY: This 24 inch computer monitor combines 1080p resolution, a 120Hz refresh rate, 1ms response time, and 300-nit brightness for fluid everyday work, streaming, study, and home office use.
  • USB C CONNECTIVITY: USB C, HDMI, and VGA give this 24 inch monitor flexible connections for compatible laptops, PCs, and Macs while helping simplify a modern home office, school, business, or study setup.
  • VARIABLE REFRESH RATE: Adaptive display technology helps this 120Hz monitor reduce tearing and provide smoother movement during scrolling, video playback, multimedia, and compatible casual gaming.
  • FRAMELESS DESIGN AND EYE CARE: Thin bezels and Eye Care features make this desktop monitor practical for single- or multi-display workspaces and more comfortable for extended productivity, research, and viewing sessions.
  • BUILT-IN AUDIO: Dual speakers add convenient sound to this PC monitor, supporting meetings, videos, training, and multimedia without separate desktop speakers while remaining compatible with laptop, PC, and Mac systems.
await page.screenshot({ path: 'viewport.png', fullPage: false });

Clip rectangles and element screenshots

A clip rectangle deliberately limits capture to a region. An element screenshot captures a target element rather than the page viewport. Remove the clip or capture the page instead of an element when you need the viewport-sized output. Playwright documents these options in its screenshot API reference.

Puppeteer has corresponding capture-region controls: fullPage, clip and captureBeyondViewport. Their behavior and option defaults are implementation-specific; check the Puppeteer ScreenshotOptions reference before translating a Playwright fix directly.

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

Isolate the setting with a minimal reproduction

  1. Record the configured viewport and screen dimensions, device scale factor, screenshot scale and intended capture region.
  2. Capture a simple page using only a known viewport: no device preset, full-page option, clip rectangle or element target.
  3. Inspect the resulting image’s pixel width and height.
  4. Reintroduce the original preset and capture options one at a time until the difference returns.

This isolates which independent control changes the result; it does not assume the screenshot service is faulty. For a hosted API, also verify its own parameter names, defaults, browser version and response metadata. The Playwright and Puppeteer options above are not universal API settings.

Rank #4
Sale
BenQ GW2490C 23.8" IPS Computer Montior 1080P FHD 144Hz Game-Ready, Home Office, USB-C, Visual Optimizer, Flicker-Free, Low Blue Light, Ultra Slim Bezel, TUV-Certified, Eye-CareU
  • 【Designed for Comfortable All-Day Productivity】 Enhance your workflow with a 24-inch IPS eye care monitor built for home office, study, and daily tasks, featuring BenQ Eye-Care technologies to reduce eye strain during extended screen time.
  • 【USB-C One-Cable Convenience】 Connect your laptop or MacBook with a single USB-C cable for video, data, reducing cable clutter and simplifying your workspace
  • 【Smooth 144Hz for Better Work Experience】 Enjoy smoother scrolling, reduced motion blur, and more responsive multitasking compared to standard 60Hz monitors—perfect for long work sessions and Gaming!
  • 【Built for Business & Office Deployment】 Designed for corporate offices, remote teams, and large-scale workstation setups. Reliable performance and consistent display quality make it ideal for IT deployment and bulk purchasing
  • 【Energy Efficient & Certified Sustainability】 Reduce energy consumption and lower operating costs—an efficient choice for businesses and users running monitors for extended hours
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Example: why a reported device capture is not a universal rule

A Playwright issue opened by Jamesj001 on June 2, 2023, reported a 980 × 1812-pixel screenshot against an emulated Pixel 5 viewport of 393 × 727 CSS pixels. The report listed Playwright 1.30.0 and a device scale factor of 2.75. The figures do not form an exact simple multiplication, and this single historical configuration does not establish a current general defect or diagnose another service. See the Playwright issue report.

Or skip the browser setup

If you need a managed capture instead of debugging a local browser, ScreenshotNeo accepts a URL in one GET request and returns an image or PDF. Its API documentation is at screenshotneo.com/docs/.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups and chat widgets before capture; bot checks, blank pages and failed loads are not billed. It also offers an MCP server for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.

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

Sign up for the free plan.

Common problems and fixes

Symptom Likely setting What to do
Bitmap width and height exceed the CSS viewport Device-pixel screenshot scale or a high device scale factor Use CSS scale for one output pixel per CSS pixel, or compare with the configured device scale factor.
Image height includes content below the fold Full-page capture Disable full-page mode when the viewport alone is wanted.
Image is cropped or has dimensions unrelated to the viewport Clip or element-target capture Remove or correct the clip, or capture the page rather than an element.
Responsive layout is wrong despite the expected bitmap size Viewport set on the wrong context/page, a preset override, or viewport changed after load Verify the page producing the screenshot, configuration order, and timing; configure before navigation.
Playwright fix has no effect in another API Different service parameters, defaults or browser version Use that service’s documentation and response metadata; Playwright and Puppeteer examples are not interchangeable.

Frequently Asked Questions

Does a screenshot’s pixel size have to equal the browser viewport?

No. The viewport is expressed in CSS pixels, while the output file is measured in image pixels. Screenshot scale and device scale factor can make those values differ.

Can this diagnosis identify the cause without knowing the API?

No. The title alone does not identify the service, framework, browser or request options. The checks narrow the cause, but the relevant implementation and version determine the exact fix.

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. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.