Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Puppeteer Screenshot Formats: PNG, JPEG, and WebP

Puppeteer supports PNG, JPEG, and WebP screenshots, with PNG as the documented default. Here’s how to choose a format and set its options.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer supports PNG, JPEG, and WebP screenshots. PNG is the documented default; to choose JPEG or WebP, set the type option and use a matching file extension. The current API reference consulted here is labeled Puppeteer 25.12.0, so check the documentation for the version you use.

Which image formats does Puppeteer support?

Puppeteer’s current ImageFormat type lists three values: png, jpeg, and webp. The API reference is labeled version 25.12.0. These are the documented screenshot image formats; the separate encoding option controls whether screenshot data is returned as Base64 or binary, not which image format is produced.

As an Amazon Associate I earn from qualifying purchases.

What is the default screenshot format?

The documented default for ScreenshotOptions.type is png. A basic capture can therefore omit type and save to a PNG path:

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

When you provide path, Puppeteer says it infers the screenshot type from the file extension. For clear, predictable code, make the extension and explicit type agree rather than relying on an accidental mismatch. See the ScreenshotOptions API reference.

How to save a screenshot as PNG, JPEG, or WebP

After navigating to the page, call page.screenshot() with the desired type and a path with the matching extension. These examples follow the documented option names; check the API for the Puppeteer version installed in your project.

PNG

await page.screenshot({ path: 'capture.png', type: 'png' });

PNG is the documented default, so specifying type: 'png' is optional when the path ends in .png.

JPEG

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

Puppeteer documents quality as a number from 0 to 100 for formats to which the option applies. Its API specifically says quality does not apply to PNG. The documentation does not prescribe a universal JPEG quality value; choose one by checking the resulting appearance and file size for your own page and use case.

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

WebP

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

WebP is a documented format option. As with JPEG, the API describes the quality range but does not recommend a particular setting or provide a format comparison. Confirm that the system receiving the file accepts WebP.

Choose a format for the destination

The Puppeteer references establish which formats and options are supported, but they do not compare output size, visual fidelity, encoding speed, or compatibility across destinations. Choose based on the receiving system’s requirements, whether transparency is needed, and your own tests with representative pages.

  • Use PNG when you want the documented default or the destination specifically requires PNG.
  • Use JPEG or WebP when the destination accepts that format and you have checked the resulting image and file size for your page.
  • Test the actual workflow if format compatibility, appearance, or file weight matters. Do not assume one format is universally smaller, sharper, faster, or more compatible.

Transparency and other screenshot options

omitBackground hides the default white background and allows a screenshot with transparency. It defaults to false. For example:

await page.screenshot({ path: 'capture.png', type: 'png', omitBackground: true });

The consulted API reference does not give a detailed comparison of transparency behavior across PNG, JPEG, and WebP, so verify the output format against the needs of your downstream software.

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

Do not confuse encoding with type: the API documents encoding separately as base64 or binary. Use type to select the image format.

Capture an element instead of the whole page

If you only need one element, the official Puppeteer screenshot guide also documents ElementHandle.screenshot(). The format options are passed to the screenshot call, for example:

const element = await page.$('#receipt');
if (!element) throw new Error('Could not find #receipt');
await element.screenshot({ path: 'receipt.webp', type: 'webp' });
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 an image or PDF without managing a Puppeteer browser, ScreenshotNeo provides a website screenshot API and MCP server. One GET request can return PNG, JPEG, WebP, or PDF. Its API can accept consent banners and remove 60+ known consent platforms, 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 identifies the page verdict and billing status.

For an image response, use the documented endpoint and replace the example target URL with the page you want to capture. See the ScreenshotNeo API documentation for request parameters and options.

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 also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 shots per month with no card required; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card required.

Frequently Asked Questions

Can Puppeteer return screenshot data instead of saving a file?

Yes. The API has a separate encoding option for Base64 or binary output; it does not select PNG, JPEG, or WebP.

Does Puppeteer recommend a particular JPEG or WebP quality value?

No universal value is specified in the cited API documentation. Test representative pages and choose based on the appearance and file size your workflow needs.

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.

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.