October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober 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 Screenshot Options: Full Page, Clips, Formats, and Quality

A practical guide to Puppeteer screenshot scope, formats, quality, transparency, and output handling, with code and fixes for common capture problems.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a whole-page capture, set fullPage: true. For a rectangular region, pass a clip; for one DOM element, call ElementHandle.screenshot(). Then choose the image type and output destination. Puppeteer’s default format is PNG, and its quality setting does not affect PNG images.

Choose the capture area

Capture the full page

Page.screenshot() captures the viewport by default. Set fullPage: true to request the entire page:

As an Amazon Associate I earn from qualifying purchases.

const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.screenshot({ path: 'full-page.png', fullPage: true });

The code assumes browser is an already launched Puppeteer browser. The path writes the resulting image to disk; the extension can inform the image type when type is not set. [Puppeteer ScreenshotOptions]

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

Capture a rectangle with clip

Use clip when you need a defined rectangle rather than the whole page. Its coordinates and dimensions describe the area to capture; ScreenshotClip also accepts scale, which defaults to 1.

await page.screenshot({
  path: 'region.png',
  clip: { x: 40, y: 120, width: 640, height: 360, scale: 1 }
});

Coordinates are useful when the region is known in advance. If the target is a page element whose position or size may change, element capture is generally the more direct fit.

Capture one DOM element

Find the element and use its screenshot method. Puppeteer scrolls it into view if needed, then captures it using page screenshot behavior.

const element = await page.$('.product-card');
if (!element) throw new Error('Product card was not found');
await element.screenshot({ path: 'product-card.png' });

An element that becomes detached from the DOM before capture causes an error. On dynamic pages, wait for the element to appear and reacquire it if the page may replace it. That is a practical way to reduce detachment failures, not a guarantee for every page. [Puppeteer Screenshots guide] [ElementHandle.screenshot()]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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

Capture beyond the viewport

The documented default for captureBeyondViewport depends on whether a clip is present: it is false without a clip and true with a clip. If your intended clip reaches beyond the current viewport, check this option and the documentation for your installed Puppeteer version rather than assuming the no-clip default applies. [ScreenshotOptions]

Pick the image format and quality

Puppeteer’s screenshot type defaults to png. The quality option accepts a number from 0 to 100, but does not apply to PNG. Do not expect to change PNG sharpness or file size by setting it.

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

Choose format based on the needs of the next step in your workflow. The official API reference lists the options but does not publish comparative benchmarks for capture speed, file size, or visual fidelity, so there is no documented universal best format. Image format and encoding are separate options in the API. [ScreenshotOptions] [ScreenshotType]

Set transparency, destination, and return representation

Transparent background

Set omitBackground: true to hide the default white background when you need a transparent capture.

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

Save to disk or keep the bytes in memory

Set path to write an image file. If you omit it, Puppeteer does not save the screenshot to disk: Page.screenshot() returns a Uint8Array by default. Set base64 encoding when your application needs a string instead.

const bytes = await page.screenshot(); // Uint8Array
const base64 = await page.screenshot({ encoding: 'base64' }); // string

The API type reference distinguishes output encoding from image type; select each for its own purpose. [Page.screenshot()] [ScreenshotOptions]

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

Common problems and fixes

  • The image shows only the viewport: Set fullPage: true for a whole-page capture. A clip, by contrast, requests a defined rectangle.
  • Changing quality has no visible effect: The documented quality setting does not apply to PNG. Use a supported non-PNG type if you need to apply that setting.
  • The clipped area outside the viewport is missing: Check captureBeyondViewport. Its default is false without a clip and true with one.
  • Element capture throws because the node is detached: The page changed or replaced the node before the screenshot. Wait for the intended element and reacquire its handle before capturing.
  • No image file appears: Without path, the API returns image data rather than writing a disk file. Save the returned bytes yourself if your workflow needs a file.
  • A page or tab change seems to race with a capture: Puppeteer documents that some page and browser-context operations wait for a screenshot to finish, while bringToFront() does not wait for existing screenshot operations. Avoid assuming that bringing a page forward synchronizes an in-progress screenshot. [Page.screenshot()]

Version and automation notes

The current API reference identifies its ScreenshotOptions page as Puppeteer 25.12.0; the ScreenshotClip reference surfaced for version 25.10.0. If an option or default differs in your environment, consult the documentation matching the Puppeteer version installed in your project. Historical screenshot changes in the changelog should not be treated as current behavior guarantees. [ScreenshotOptions] [ScreenshotClip] [Puppeteer changelog]

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 Puppeteer and a browser, ScreenshotNeo is a website screenshot API and MCP server. Its GET endpoint accepts a URL; this cURL example saves a WebP capture. See the ScreenshotNeo API docs for parameters.

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://example.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and each response reports the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is on every plan.

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

Frequently Asked Questions

Does fullPage: true capture one specific element?

No. It requests a full-page capture; use ElementHandle.screenshot() to capture a DOM element.

Does Puppeteer save a screenshot file if I omit path?

No. It returns image data in memory; the default result is a Uint8Array.

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.

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