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 as WebP: Format and Quality Options

Set Puppeteer’s screenshot type to WebP and optionally choose a quality value from 0 to 100. See complete Node.js examples, element capture, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yes. Puppeteer supports WebP screenshots: set type: 'webp' in page.screenshot(). To set an image-quality value, use quality from 0 to 100; Puppeteer’s API says this option does not apply to PNG. PNG is the documented default, so specify WebP when that is the format you need.

Set WebP format and quality

For a file-based screenshot, provide a WebP filename and explicitly set the format. The quality value below is an example, not a universal recommendation:

As an Amazon Associate I earn from qualifying purchases.

await page.screenshot({
  path: 'capture.webp',
  type: 'webp',
  quality: 80,
});

Puppeteer documents type options including PNG, JPEG, and WebP. Its current API reference documents PNG as the default and says screenshot type can be inferred from the file extension. Using both path: 'capture.webp' and type: 'webp' makes the intended format explicit. Puppeteer ScreenshotOptions API

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.

Complete Node.js example

This example launches Puppeteer, opens a page, saves a WebP screenshot, and closes the browser. It follows the documented API shape and has not been independently tested here.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();

try {
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({
    path: 'capture.webp',
    type: 'webp',
    quality: 80,
  });
} finally {
  await browser.close();
}

Install Puppeteer in your project and run this in a Node.js environment configured for ES modules. The navigation target is an example URL; change it to the page you want to capture. For the documented workflow and options, see the Puppeteer screenshots guide.

What the quality setting means

Puppeteer documents quality as a number from 0 to 100 and states that it is not applicable to PNG images. The API reference does not designate a best WebP value or publish file-size or visual-quality comparisons for particular values.

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

If file size matters, capture representative pages in your own rendering environment at several quality settings. Compare the resulting files against your visual requirements and choose accordingly; the setting alone does not establish a predictable file size or a universally acceptable appearance.

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

Capture an element instead of the page

For an element-level capture, use ElementHandle.screenshot() with the same screenshot options:

const element = await page.$('.receipt');
if (!element) {
  throw new Error('Could not find .receipt');
}

await element.screenshot({
  path: 'receipt.webp',
  type: 'webp',
  quality: 80,
});

The element screenshot API inherits ScreenshotOptions, so the format and quality settings apply there too. Puppeteer ElementHandle.screenshot API

Receive screenshot data instead of writing a file

Page.screenshot() also has a binary overload that returns a Promise<Uint8Array>. You can write those bytes yourself, which is useful when your application controls storage:

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
import { writeFile } from 'node:fs/promises';

const bytes = await page.screenshot({
  type: 'webp',
  quality: 80,
});
await writeFile('capture.webp', bytes);

The API also documents a base64 overload that returns a string. Choose the overload that matches how you handle the result; the screenshot options still specify the output format. Puppeteer Page.screenshot API

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

Common problems and fixes

  • The output is PNG, not WebP: PNG is the documented default. Set type: 'webp', or rely on extension inference by using a .webp path. For an unambiguous file-based request, set both.
  • Quality has no effect: The documented quality option does not apply to PNG. Confirm the capture is WebP or JPEG rather than PNG.
  • Your chosen quality produces an unexpected size or appearance: Puppeteer does not publish a universal recommended setting or a numeric size-to-quality guarantee. Compare actual captures from your pages and environment.
  • Your installed version does not accept WebP: WebP screenshot support was added in Puppeteer 10.4.0, released September 21, 2021; Puppeteer 20.8.0, released July 6, 2023, added WebP to the screenshot quality allow list. Check the API and types for the version installed in your project rather than assuming every older release has current behavior. Puppeteer release history
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 you need a screenshot through an API rather than running Puppeteer yourself, ScreenshotNeo accepts one GET request and can return PNG, JPEG, WebP, or PDF. Cookie banners are accepted like a visitor and removed along with supported newsletter popups and chat widgets before capture; those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides screenshot and page-info tools for AI agents, including Claude, Cursor, and other MCP clients.

For WebP output, use the API’s format option as documented at ScreenshotNeo API documentation. A cURL request looks like this:

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

The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.

Frequently Asked Questions

Does Puppeteer support WebP screenshots?

Yes. Set type: 'webp' in screenshot options, or use a WebP file extension for format inference.

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

What quality value should I use for a Puppeteer WebP screenshot?

Puppeteer documents a 0–100 range but does not prescribe a universally best value. Test representative captures against your size and visual requirements.

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
PC Slower Than It Used to Be?Free scan - under a minute
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.