Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober 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 Scan×
Skip to content
World desk4 min

How to Set a Screenshot API Device Scale Factor for Retina Captures

Set a screenshot’s device scale factor for retina output, distinguish device pixels from CSS pixels, and verify dimensions across browser tools and APIs.

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.

For a 2× retina screenshot, set the browser’s device scale factor to 2 and make sure the screenshot output uses device pixels rather than CSS pixels. These are separate settings in Playwright; screenshot APIs may expose them differently, so use the parameter and output behavior documented for the service you choose.

What the device scale factor changes

A device scale factor represents the device pixel ratio used for browser rendering. At a factor of 2, a viewport that is 375 by 667 CSS pixels can render at 750 by 1,334 device pixels when the output is captured at device scale. That gives the image more pixels for the same CSS layout; it does not make the webpage’s CSS viewport larger.

As an Amazon Associate I earn from qualifying purchases.

In Playwright, the context’s deviceScaleFactor and screenshot’s scale are distinct controls. scale: "css" produces one output pixel per CSS pixel; scale: "device" produces one output pixel per device pixel. If you raise the context factor but capture at CSS scale, the resulting image may not have the higher pixel dimensions you expect. See Playwright’s screenshot reference and browser context options.

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

Set a retina factor in Playwright

Configure the factor when creating the browser context, then request device-scale output in the screenshot call. This complete Node.js example saves a PNG for a 375-by-667 CSS-pixel viewport at 2×:

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

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext({
    viewport: { width: 375, height: 667 },
    deviceScaleFactor: 2,
  });
  const page = await context.newPage();

  await page.goto('https://example.com', { waitUntil: 'networkidle' });
  await page.screenshot({ path: 'retina.png', scale: 'device' });

  await browser.close();
})();

Replace the example URL with the page you need. For a full-page capture, add fullPage: true to page.screenshot(). If you only need the normal CSS-pixel dimensions, use scale: "css" instead. Playwright notes that device-scale screenshots can be twice as large or larger, so account for the output file’s dimensions and memory use.

Configure hosted screenshot APIs carefully

There is no universal screenshot API parameter name or range. Check whether the service expects the factor as a viewport setting, request option, or session/context configuration, and whether it outputs CSS or device pixels. Do not assume that a setting named deviceScaleFactor guarantees a 2× file unless the API documents that output behavior.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Browserless REST Screenshot API

Browserless documents a POST request to /screenshot with a JSON body containing the URL and an options object. Its screenshot documentation describes viewport size and device scale factor among the supported options. The separate ViewportOptions reference names deviceScaleFactor and says it defaults to 1. Use the current endpoint’s OpenAPI reference to confirm the precise request schema for your Browserless API version.

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

Browserless also documents a GraphQL viewport mutation that accepts width, height, and deviceScaleFactor; its mobile example uses a 375-by-667 viewport and explicitly supplies the factor. Refer to the Browserless viewport documentation for the applicable request format. These examples describe configuration, not guaranteed dimensions for every endpoint or page.

Other providers and command-line tools

  • ScreenshotAPI’s reference lists deviceScaleFactor from 1 to 5 and separately describes rendering scale as css or device. Verify how the two interact in the current API before relying on a particular output size.
  • shot-scraper provides a tool-specific --retina option that uses device scale factor 2. That flag is not a general parameter shared by screenshot APIs.

How to verify the result

  1. Choose the CSS viewport dimensions you actually need; do not double those dimensions just to get a 2× image.
  2. Set the device scale factor to 2 in the context or request configuration documented by your tool.
  3. Choose device-pixel output if the API offers an output-scale setting and you want twice the pixel width and height.
  4. Inspect the saved image’s pixel dimensions. For a 375-by-667 CSS viewport at 2×, a viewport-sized capture should be 750 by 1,334 pixels, subject to the tool’s documented behavior and any full-page setting.
  5. If the dimensions remain at the CSS viewport size, check whether the screenshot was captured at CSS scale or whether the provider applies the factor elsewhere.

Troubleshooting retina captures

  • Image dimensions did not increase: In Playwright, check that deviceScaleFactor is set on the browser context and scale: "device" is set on the screenshot. In a hosted API, confirm its output-scale behavior rather than assuming the factor alone controls the file.
  • The image is unexpectedly large: Device-scale output multiplies pixel dimensions in both directions. A 2× width and 2× height means four times as many pixels as a 1× image; use CSS scale if you need CSS-sized output.
  • The API rejects the setting: Check the exact spelling, accepted range, nesting, and endpoint version in that provider’s reference. Names and ranges differ; ScreenshotAPI, for example, documents 1 to 5.
  • The result looks different from a physical phone: A device scale factor changes pixel density emulation, not every aspect of a real device. Set viewport dimensions and any other supported device emulation options separately.

Or skip the browser setup

ScreenshotNeo accepts a retina scale option alongside its screenshot parameters. Use the API to request a 2× capture; consult the ScreenshotNeo documentation for the current parameter names and output options.

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

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. 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. Its MCP server gives AI agents screenshot tools, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000.

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

Does a retina capture require a physical accessory?

No. The cited browser, API, and command-line documentation describes this as a software configuration.

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