Free tools Windows power users keep installed
One-click scans. No signup required.
Set Playwright screenshot quality with the quality option and choose a lossy-capable format: type: 'jpeg' or type: 'webp'. The value is a number from 0 through 100. It has no effect on PNG. JPEG defaults to quality 80; WebP defaults to 100, which Playwright documents as lossless. The right value depends on your visual and file-size requirements, so compare representative pages rather than treating any number as universally optimal.
The basic setting
Pass quality in the options object used by page.screenshot():
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({
path: 'example.jpg',
type: 'jpeg',
quality: 60,
});
await browser.close();
Here, type selects JPEG and quality: 60 selects the encoder setting. Values outside 0–100 are invalid. The example value is only a starting point, not a documented optimum.
Choose the output format before choosing quality
JPEG for broadly compatible, lossy images
Use type: 'jpeg' when a smaller image is more important than preserving every pixel. JPEG’s documented default quality is 80. Text, sharp borders and small interface icons can show blocking or ringing as quality falls, so inspect the actual output at its intended display size.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
await page.screenshot({
path: 'dashboard.jpg',
type: 'jpeg',
quality: 80,
});
If the filename ends in .jpg or .jpeg, Playwright can infer the type from the extension. Specifying both type and the extension makes the intent obvious and avoids surprises when a path changes.
WebP for lossless or smaller lossy output
WebP’s documented default is 100, and Playwright describes that setting as lossless. A value below 100 switches to lossy WebP compression.
await page.screenshot({
path: 'dashboard.webp',
type: 'webp',
quality: 100,
});
await page.screenshot({
path: 'dashboard-small.webp',
type: 'webp',
quality: 75,
});
Choose 100 when exact visual reproduction matters. Choose a lower value only after checking the resulting artifacts and file size for your pages. Playwright’s API reference does not prescribe a universal WebP value.
PNG when you need lossless output with no quality control
PNG is the default screenshot type when no type or extension determines another format. The quality option does not apply to PNG, so this does not create a lower-quality PNG:
Recommended Free Tools
await page.screenshot({
path: 'dashboard.png',
type: 'png',
quality: 20, // ignored for PNG; do not use this to reduce size
});
For a smaller PNG, change the captured dimensions, remove unnecessary content, or use a separate image optimization pipeline. Do not expect quality to alter PNG encoding.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Quality, dimensions and scale are different controls
quality changes compression for JPEG and WebP. It does not change the number of pixels. Pixel dimensions are affected by the viewport, clipping, fullPage, and the scale option.
| Goal | Setting | Effect |
|---|---|---|
| One output pixel per CSS pixel | scale: 'css' |
Keeps high-DPI screenshots comparatively small. |
| One output pixel per device pixel | scale: 'device' |
Captures device-pixel detail; high-DPI images can be twice as large or more. |
| Change compression | quality: 0..100 |
Applies to JPEG and WebP, not PNG. |
await page.screenshot({
path: 'css-scale.webp',
type: 'webp',
quality: 80,
scale: 'css',
});
If files are unexpectedly huge, check scale and viewport size before lowering quality. A device-scale capture may contain far more pixels than the same CSS-scale capture.
Control what is captured for repeatable results
Compression cannot fix a capture that changes from run to run. Stabilize the page first, then tune encoding.
Wait for the page state you need
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.locator('[data-testid="report"]').waitFor({ state: 'visible' });
await page.screenshot({ path: 'report.jpg', type: 'jpeg', quality: 70 });
Use a locator wait for content that appears after navigation. A fixed delay can be useful for a known transition, but it is less reliable than waiting for a selector or the network condition that represents readiness.
Disable animation and hide unstable areas
await page.screenshot({
path: 'stable.png',
animations: 'disabled',
mask: [page.locator('.live-clock'), page.locator('.personalized-ad')],
maskColor: '#808080',
style: '* { caret-color: transparent !important; }',
});
animations: 'disabled' fast-forwards finite animations and cancels infinite ones for the capture, then restores infinite animations. Masks cover dynamic elements. The style option can inject capture-only CSS. These controls affect pixels, not JPEG/WebP compression.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Capture the full page or a bounded region
await page.screenshot({
path: 'long-page.webp',
type: 'webp',
quality: 85,
fullPage: true,
});
await page.screenshot({
path: 'hero.jpg',
type: 'jpeg',
quality: 75,
clip: { x: 0, y: 0, width: 1280, height: 500 },
});
fullPage captures the scrollable page rather than only the viewport. clip limits the capture to a rectangle. Both can change file size substantially because they change the pixel area.
Transparent backgrounds
omitBackground: true can preserve transparency for formats that support it. It is not applicable to JPEG, whose background must be rendered as an opaque color. Use PNG or an appropriate WebP workflow when transparency is required.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Element screenshots use the same quality rules
locator.screenshot() exposes the same format and quality options while targeting one element:
const card = page.locator('[data-testid="pricing-card"]');
await card.screenshot({
path: 'pricing-card.webp',
type: 'webp',
quality: 90,
});
Playwright scrolls the element into view and performs actionability checks. If the element is detached before capture, the call fails; locate it again after the page finishes rendering rather than retaining a stale element handle.
Quality choices for common delivery goals
| Requirement | Format and approach | What to verify |
|---|---|---|
| Pixel-accurate archival capture | PNG, or WebP at 100 | Transparency needs, dimensions and storage size. |
| Web previews and thumbnails | JPEG with a measured quality value, or lossy WebP below 100 | Text edges, gradients and file size on representative pages. |
| High-DPI test artifacts | Choose scale deliberately, then choose compression |
Whether device-pixel dimensions are actually required. |
| Visual regression assertions | Use the assertion workflow’s lossless PNG or WebP snapshots | Assertion tolerances and animation defaults, which are separate from ordinary screenshot calls. |
There is no official table mapping a quality number to a guaranteed file size or visual score. Benchmark your own page set if storage, bandwidth or review time is significant.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
JavaScript and TypeScript patterns
Reusable helper with explicit validation
import type { Page } from 'playwright';
type Format = 'jpeg' | 'webp' | 'png';
export async function saveShot(
page: Page,
path: string,
format: Format,
quality?: number,
) {
if (quality !== undefined && (format === 'png' || quality < 0 || quality > 100)) {
throw new Error('Quality must be 0–100 and is only valid for JPEG or WebP');
}
await page.screenshot({ path, type: format, quality });
}
await saveShot(page, 'home.jpg', 'jpeg', 70);
await saveShot(page, 'reference.webp', 'webp', 100);
await saveShot(page, 'reference.png', 'png');
The check prevents a misleading configuration in which a caller believes a PNG’s quality was changed.
Buffer output for an upload
const bytes = await page.screenshot({
type: 'webp',
quality: 80,
scale: 'css',
});
// Send bytes to your storage or HTTP client; no local file is required.
Troubleshooting
“Quality does nothing”
- Confirm the output is JPEG or WebP, not PNG.
- Check that the value is between 0 and 100.
- Ensure you are inspecting the newly written file rather than a cached artifact.
- Remember that a large viewport or
scale: 'device'can dominate file size even after compression.
The screenshot is blurry or has halos
- Raise JPEG or lossy WebP quality and compare text, icons and gradients.
- Use WebP 100 or PNG when lossless output is required.
- Check that the page itself is not rendering low-resolution or lazy-loaded assets.
The call fails because an element is missing
- Wait for a stable selector before calling
locator.screenshot(). - Verify the locator matches one visible element.
- If the framework replaces the node, resolve the locator again immediately before capture.
Output is unexpectedly enormous
- Inspect viewport dimensions,
fullPageandscale. - Capture only the element or clip rectangle you need.
- Use JPEG or lossy WebP after checking that artifacts are acceptable.
Transparent output fails
Do not use JPEG with omitBackground. Choose PNG or a WebP configuration that preserves the transparency your consumer supports.
Test-runner screenshots are a separate setting
Playwright Test’s configuration option named screenshot controls when the runner saves artifacts, with modes such as off, on, only-on-failure and on-first-failure. It can also set options such as fullPage and omitBackground. That scheduling configuration is different from the encoding options on page.screenshot(); set quality on the API call that produces the image.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server when you need a rendered URL without maintaining Playwright browser setup. A single GET request returns PNG, JPEG, WebP or PDF. Before capture it accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing result.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const body = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', body));
See the ScreenshotNeo documentation for all request options. It supports full-page and selector captures, dark mode, device and custom viewports, retina scale, PDF controls, custom CSS and JavaScript, clicks, waits, blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage data and an OpenAPI specification. An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsThe Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan, and yearly billing gives two months free. Create a free ScreenshotNeo account to try it without a card.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Visual regression assertions are not ordinary screenshots
Screenshot assertions use .png or .webp snapshots and both are lossless. Their pixel-difference tolerances and animation defaults belong to the assertions API. Do not infer those defaults from a standalone page.screenshot() call, and do not use lossy quality settings for a baseline whose purpose is pixel comparison.
Frequently Asked Questions
Can I set quality when saving a PNG in Playwright?
No. Playwright’s quality option applies to JPEG and WebP. A PNG path or explicit PNG type ignores it.
Does quality 100 always mean lossless?
For WebP, Playwright documents the default quality of 100 as lossless. JPEG remains a lossy format even at its highest setting.
Why is my high-DPI screenshot much larger?
With scale set to device, Playwright emits one pixel per device pixel. Use CSS scale when one pixel per CSS pixel is sufficient.
Should visual regression tests use JPEG quality?
No. Use the assertion workflow’s lossless PNG or WebP snapshots and configure its comparison tolerances separately.
Quick Recap
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.

