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.

Set type: 'webp' in Playwright’s screenshot options, or save the file with a .webp extension so Playwright can infer the format. For a saved screenshot, the explicit option makes the intended output clear:

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

Save a WebP screenshot with Playwright

Install Playwright in your project, launch a browser, navigate to the page, and call page.screenshot() with a WebP type. This JavaScript example writes the screenshot to capture.webp:

import { chromium } from 'playwright';

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

The API accepts png, jpeg, and webp. When you supply a path, Playwright can infer the format from its extension; the API documentation states, “The screenshot type will be inferred from file extension.” Specifying both the extension and type is useful when you want the code to state its intended format explicitly. See the Playwright Page API for the screenshot options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works

The example uses try/finally so the browser is closed even if navigation or capture throws an error. If your project does not already have Playwright installed, follow the installation instructions for your chosen package and browser setup in the Playwright documentation.

Choose the screenshot output you need

Capture the visible viewport

The basic call captures the page’s current viewport. If you need a particular viewport size, create the page with explicit dimensions:

const page = await browser.newPage({
  viewport: { width: 1440, height: 900 }
});
await page.goto('https://example.com');
await page.screenshot({ path: 'viewport.webp', type: 'webp' });

Use the same viewport for visual comparisons. A different viewport can change responsive layout, line wrapping, and visible content even when the page itself has not changed.

Capture the full page

Set fullPage: true to capture the full scrollable document rather than only the current viewport:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.screenshot({
  path: 'full-page.webp',
  type: 'webp',
  fullPage: true
});

Full-page capture can produce a tall image and may take longer or use more memory than a viewport capture, particularly on long pages. The option changes the captured area; it does not guarantee that every lazy-loaded image or dynamically rendered section has appeared. If the page loads content as it scrolls, scroll or otherwise trigger that content before taking the screenshot, then confirm the resulting image includes it.

Capture one element

Use a locator’s screenshot method to save a particular matching element rather than the page:

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.
await page.locator('main').screenshot({
  path: 'main.webp',
  type: 'webp'
});

Choose a selector that uniquely identifies the intended element. Locator screenshots are useful for a component or panel; if the locator matches no element or matches an unexpected one, correct the selector or wait for the intended content before capture. The Playwright screenshot guide covers page, full-page, and element captures.

Keep the image in memory

Omit path to receive image bytes instead of saving directly to a file:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const bytes = await page.screenshot({ type: 'webp' });

The returned bytes can be passed to another part of your application, written to storage, or returned from a service. When writing them yourself, use a filename ending in .webp so tools that inspect the extension can identify the format.

Set WebP quality, pixel scale, and transparency

Quality: lossless or lossy

For formats other than PNG, the screenshot API documents a quality setting from 0 to 100. For WebP, quality: 100 produces lossless output; lower values are lossy:

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

For example, a lower quality value can be used where lossy output is acceptable:

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

There is no universal best quality setting or guaranteed file-size reduction for a particular page. If the image is for visual regression testing, prefer lossless output unless you have deliberately chosen to test a lossy artifact. For delivery or storage, compare the actual output at the quality levels that meet your visual requirements rather than assuming a particular percentage will reduce file size by a fixed amount.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Scale: CSS pixels or device pixels

The screenshot API’s scale option controls output pixel dimensions. 'css' produces one image pixel per CSS pixel. 'device' uses device pixels and is the documented default; on high-DPI devices it can yield a substantially larger image.

await page.screenshot({
  path: 'css-scale.webp',
  type: 'webp',
  scale: 'css'
});

Use CSS scale when a compact output tied to the page’s CSS dimensions is appropriate. Use device scale when you need the device-pixel detail. For visual baselines, keep scale consistent between the baseline and subsequent captures: changing it changes pixel dimensions and can make otherwise similar screenshots incomparable.

Transparent background

Set omitBackground: true when you need a transparent page background:

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

Confirm that the tool or destination consuming the image preserves transparency. JPEG does not support this option; WebP and PNG are the relevant formats for transparent output.

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

Use WebP for Playwright Test visual snapshots

For a visual snapshot in Playwright Test, give the screenshot assertion a WebP filename:

import { test, expect } from '@playwright/test';

test('homepage visual snapshot', async ({ page }) => {
  await page.goto('https://example.com');
  await expect(page).toHaveScreenshot('homepage.webp');
});

To set WebP as the format for unnamed snapshots, configure the expectation in playwright.config.ts or your TypeScript configuration file:

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
import { defineConfig } from '@playwright/test';

export default defineConfig({
  expect: {
    toHaveScreenshot: {
      type: 'webp'
    }
  }
});

Playwright’s visual comparison documentation describes WebP snapshots as lossless. The toHaveScreenshot() assertion waits for two consecutive captures to match before comparing the result, and screenshot assertion animation handling defaults to disabled. Those behaviors help reduce some sources of variation, but they do not make a dynamic page deterministic: content, fonts, network responses, and application state can still affect a capture. Use a stable test state and the same viewport and scale for comparisons. See Playwright visual comparisons and the PageAssertions API.

Choose settings by purpose

Need Setting or method Trade-off
Save a WebP file type: 'webp' and a .webp path Explicit format is easy to see in code; a WebP path also lets Playwright infer the type.
Capture beyond the viewport fullPage: true Includes the full scrollable page, which can mean a much taller image.
Capture a component locator(selector).screenshot() Targets a matching element; selector choice and page readiness matter.
Use bytes in application code Call page.screenshot({ type: 'webp' }) without path Returns bytes rather than writing a file directly.
Preserve WebP image detail quality: 100 Lossless output; lower values are lossy. No fixed file-size ratio is established.
Match CSS dimensions scale: 'css' One pixel per CSS pixel; may have less device-pixel detail.
Capture device-pixel detail scale: 'device' Uses device pixels and may produce larger output; this is the API default.
Use a transparent background omitBackground: true with WebP or PNG Check transparency support in the receiving pipeline; JPEG is not suitable.
Run a visual assertion Use toHaveScreenshot('name.webp') or configure type: 'webp' Requires Playwright Test, not only the Playwright library.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common problems and fixes

The file is not WebP

Set type: 'webp' and use a .webp filename. Check that another step in your pipeline has not renamed or converted the file after Playwright writes it. If you omit path, remember that you are handling returned bytes rather than a file Playwright named for you.

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

The screenshot is blank or incomplete

Make sure navigation has completed sufficiently for the page’s content and styles to render before capture. For single-page applications or pages that load content after navigation, wait for a meaningful locator or other page-specific readiness condition rather than relying on a fixed short delay. For full-page shots of lazy content, trigger the content’s loading behavior before capturing.

Visual snapshots differ unexpectedly

Keep the viewport, scale, page state, and capture target the same across runs. A change from device scale to CSS scale changes pixel dimensions. Dynamic content, animation, timestamps, and data that changes between test runs can also cause differences; stabilize those inputs where possible. Playwright Test’s screenshot assertion handles animations by default, but other changing content may still need test-specific control.

The capture fails because a locator is missing

Verify that the selector identifies an element on the current page and that the page has rendered it before invoking the locator screenshot. If the element is conditional, make the test establish the required state first.

Transparency disappears downstream

Check the output format and the receiving image pipeline. Use WebP or PNG with omitBackground: true; do not convert the result to JPEG if the transparent background must be retained.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video

WebP is rejected in an older or different setup

Playwright’s documented API describes WebP screenshot support, but support history can vary by language binding and installed version. A release-note result identified Page and Locator screenshot WebP support in Java as added in Playwright 1.62; that does not establish a complete compatibility matrix for other bindings, browser engines, or earlier versions. Check the API and release notes for the exact binding and version you use rather than applying that Java version note universally.

Or skip the browser setup

If you need a WebP screenshot without launching and managing Playwright yourself, ScreenshotNeo is a website screenshot API and MCP server for developers. Its API returns PNG, JPEG, or WebP screenshots and PDFs; the request below asks for a WebP capture. See the ScreenshotNeo API documentation for the request options.

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

ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture; those cleanup steps can each be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

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

Frequently Asked Questions

Does Playwright Test need a separate WebP configuration for named snapshots?

No. Use a filename such as homepage.webp; configure the default type when you want unnamed snapshots to use WebP.

Can I capture a WebP screenshot without saving it to disk?

Yes. Omit path and page.screenshot() returns image bytes.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.90
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
Bestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.99

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.