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.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Short answer: In Page.captureScreenshot, clip is a Page.Viewport object. Its x, y, width, and height describe a rectangle in device-independent pixels (DIP). Its scale field is documented only as the page scale factor. The current protocol reference does not define an output-pixel formula, identify this value as device pixel ratio, or describe it as an image-resizing setting.

The exact field you are setting

The path matters: Page.captureScreenshot → clip → Page.Viewport → scale. The screenshot method uses clip to capture only a specified region. That region is represented by four geometric values and one scale value.

Field Documented meaning Unit or role
x Horizontal offset of the clip rectangle Device-independent pixels (DIP)
y Vertical offset of the clip rectangle Device-independent pixels (DIP)
width Clip rectangle width Device-independent pixels (DIP)
height Clip rectangle height Device-independent pixels (DIP)
scale Page scale factor Scaling role; the reference does not state an output-size equation

DIP is a logical coordinate system used by the browser. Do not automatically substitute physical monitor pixels, CSS pixels, or a device pixel ratio for these values. The protocol definition establishes the units for the rectangle, but it does not explain every rasterization step that follows.

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

What clip.scale does—and what the reference does not promise

The official field description for Page.Viewport.scale is simply “Page scale factor.” That wording tells you the value participates in page scaling, but it does not specify a conversion such as output width = width × scale. It also does not say that the result will have a particular encoded pixel dimension.

  • Use x, y, width, and height to identify the logical rectangle.
  • Treat scale as the page-scale control documented by the protocol, not as a guaranteed device-pixel-ratio or export-resolution control.
  • Keep image encoding options separate. format defaults to PNG and can be set to JPEG or WebP; quality is an integer from 0 to 100 for JPEG.
  • If an exact raster size is a requirement, pin the Chrome and protocol versions and verify the returned image in your own reproducible test.

Those limits are important for screenshot pipelines that allocate storage, generate thumbnails, or compare images byte-for-byte. The rolling protocol reference is an API description, not a promise that covers every implementation detail or historical version.

A minimal capture command

After connecting to a page through the Chrome DevTools Protocol, send a command like this:

{
  'id': 7,
  'method': 'Page.captureScreenshot',
  'params': {
    'format': 'png',
    'clip': {
      'x': 120,
      'y': 300,
      'width': 800,
      'height': 600,
      'scale': 1
    }
  }
}

The response contains the encoded screenshot data (normally in a data field). The example asks for an 800 by 600 DIP region beginning at (120, 300) and uses a page scale factor of 1. It does not establish that the decoded file must be 800 by 600 physical pixels; inspect the file if that distinction matters.

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

Running the command against Chrome

Prerequisites

  • Launch Chrome or Chromium with remote debugging enabled, for example with --remote-debugging-port=9222.
  • Have a page open in that debugging instance.
  • Use a CDP client or Protocol Monitor to send the command and read the response.

Protocol Monitor workflow

  1. Open Chrome DevTools and press Ctrl+Shift+P (or Cmd+Shift+P on macOS).
  2. Choose Show Protocol Monitor. If it is not available, enable the Protocol Monitor experiment in DevTools settings first.
  3. Select the page target, choose the Page.captureScreenshot command, and add a clip object with the fields shown above.
  4. Submit the command, decode the returned data, and record both the requested geometry and the decoded image dimensions.

The protocol overview and its mirrored definitions are useful for checking the command shape. They do not add a formula for the effect of Page.Viewport.scale.

A small Python example

This example assumes Chrome is listening on port 9222 and that the websocket-client package is installed. It selects the first page target, enables the Page domain, navigates to a URL, waits briefly for protocol traffic, captures a clip, and writes the returned PNG.

import base64
import json
import time
import urllib.request
import websocket

pages = json.load(urllib.request.urlopen('http://127.0.0.1:9222/json/list'))
page = next(p for p in pages if p.get('type') == 'page')
ws = websocket.create_connection(page['webSocketDebuggerUrl'])
next_id = 0

def call(method, params=None):
    global next_id
    next_id += 1
    ws.send(json.dumps({'id': next_id, 'method': method, 'params': params or {}}))
    while True:
        message = json.loads(ws.recv())
        if message.get('id') == next_id:
            return message

call('Page.enable')
call('Page.navigate', {'url': 'https://example.com'})
time.sleep(2)
result = call('Page.captureScreenshot', {
    'format': 'png',
    'clip': {'x': 0, 'y': 0, 'width': 800, 'height': 600, 'scale': 1}
})
if 'error' in result:
    raise RuntimeError(result['error'])
with open('clip.png', 'wb') as image:
    image.write(base64.b64decode(result['result']['data']))
ws.close()

For production code, replace the fixed sleep with an event-driven readiness rule, select a target deterministically, handle navigation failures, and log the Chrome version. Those changes make repeated measurements more meaningful when you are investigating scale behavior.

Do not confuse this with emulation scale

Emulation.setDeviceMetricsOverride has a separate property also named scale. Its documented description is “Scale to apply to resulting view image.” That is not the same field as Page.Viewport.scale.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Protocol location Documented role Use it when
Page.captureScreenshot.params.clip.scale Page scale factor for the clipped viewport You are defining a capture region and its page-scale value
Emulation.setDeviceMetricsOverride.params.deviceScaleFactor Device scale factor for emulated metrics You are emulating a device’s pixel density
Emulation.setDeviceMetricsOverride.params.scale Scale applied to the resulting view image You are configuring emulation’s resulting view image

Because the names overlap, a debugging log should record the complete method and parameter path, not just the word scale. Setting an emulation value does not redefine the meaning of clip.scale.

How to reason about dimensions

When you need a specific crop

Specify the rectangle in DIP, capture it, then inspect the decoded file’s width and height. This two-step check is safer than assuming a multiplication rule. It also catches effects from the Chrome version, target configuration, and image encoding.

When you need a specific device density

Configure emulated device metrics explicitly, including the device scale factor, and document those settings alongside the capture command. Do not try to achieve a density contract by changing only clip.scale.

When you need a predictable comparison

Pin the browser build, operating system image, viewport configuration, fonts, and page state. Save the command parameters and the decoded dimensions with every fixture. A protocol field description alone cannot guarantee identical rasterization across moving browser versions.

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

Format and quality are separate controls

The screenshot method’s format parameter controls encoding: PNG is the default, while JPEG and WebP are also allowed. JPEG accepts an integer quality from 0 through 100. Neither setting changes the documented units of clip.x, clip.y, clip.width, or clip.height.

  • Choose PNG for lossless UI or pixel-diff work.
  • Choose JPEG when a smaller photographic file is more important than lossless edges; supply a quality value in the documented range.
  • Choose WebP when your consumer supports it and you want that encoding, while still measuring the resulting file rather than inferring dimensions from the clip object.

Common problems and fixes

“My 800 by 600 clip is not an 800 by 600 image.”

The protocol defines the clip geometry in DIP and labels scale as a page scale factor; it does not publish an output-pixel equation. Decode the response and record its dimensions for the exact Chrome build and settings you use.

“Changing clip.scale did not act like device pixel ratio.”

That is an unsafe assumption. Device density belongs to emulation settings, while the clip field has its own documented role. Set and log Emulation.setDeviceMetricsOverride values when density emulation is your goal.

“The command is rejected.”

Check that you are connected to a page target, that the method is spelled Page.captureScreenshot, and that clip contains numeric x, y, width, height, and scale values. Also confirm that your client is speaking the protocol version supported by that Chrome instance.

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.

“The image is blank or captures the wrong content.”

Verify the selected target, wait for navigation and layout to settle, and ensure the rectangle intersects the page you intended. Log the target URL and navigation result before diagnosing scale.

“Results changed after a Chrome update.”

Pin the browser version for tests, retain a small fixture page, and rerun the same command while recording decoded dimensions. The current reference is rolling, so historical behavior should not be inferred from today’s wording.

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

Or skip the browser setup

If your goal is a dependable website image rather than learning CDP internals, ScreenshotNeo provides a single HTTP endpoint and an MCP server for developers and AI agents.

See the ScreenshotNeo API documentation for parameters and response details, then run:

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

ScreenshotNeo accepts cookie and consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response reports the page verdict and billing status in X-Page-Verdict and X-Billed headers. Its MCP tools—take_screenshot, get_page_info, and capture_pdf—let Claude, Cursor, or another MCP client request captures without you managing a browser session.

One thousand screenshots per month are free with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan. Create a free ScreenshotNeo account to get started.

Using ScreenshotNeo from common clients

Python

import requests
r = requests.get('https://api.screenshotneo.com/v1/shot', params={'access_key': 'YOUR_API_KEY', 'url': 'https://stripe.com'}, timeout=90)
r.raise_for_status()
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}`);
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

This service is an alternative to a hand-built CDP pipeline when you need full-page captures, selector-based crops, custom CSS or JavaScript, waits, request blocking, cookies, headers, device presets, PDFs, caching, signed links, asynchronous jobs, bulk capture, or a usage API. Those controls do not change the documented meaning of Chrome’s Page.Viewport.scale; they simply remove the need to operate Chrome directly.

What to document in a scale investigation

  • Chrome/Chromium version and CDP version.
  • Target URL, page state, viewport size, and emulation settings.
  • Complete clip object, including the scale value.
  • Screenshot format and, for JPEG, quality.
  • Decoded image dimensions and file size.
  • Whether the result came from a page target, an emulated device, or a service abstraction.

This record separates what the protocol guarantees from what your particular browser build actually renders. It is the appropriate way to answer an output-size question that the field reference leaves open.

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

Frequently Asked Questions

Is clip.scale the same as deviceScaleFactor?

No. They are different parameters in different protocol contexts. The clip field is documented as a page scale factor; device scale factor is part of emulated device metrics.

Does setting scale: 2 guarantee a screenshot twice as wide?

No guarantee is stated in the protocol reference. Measure the decoded image for the pinned Chrome version and configuration you use.

Where do JPEG quality settings belong?

They belong to Page.captureScreenshot‘s separate quality parameter and apply when format is JPEG; the allowed integer range is 0–100.

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.