Use Playwright’s page.screenshot() method with a JPEG filename. In Node.js, await page.screenshot({ path: 'screenshot.jpeg', type: 'jpeg' }) saves the page image as a JPEG. The filename extension can select the format automatically; specifying type: 'jpeg' makes that choice explicit.
Save a page screenshot as JPEG
Install Playwright and its browser for your project, then navigate to the page and call page.screenshot(). This complete Node.js example saves a full-page JPEG:
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({
path: 'screenshot.jpeg',
type: 'jpeg',
quality: 85,
fullPage: true,
});
} finally {
await browser.close();
}
})();
Save the code as a JavaScript file in your Playwright project and run it with Node.js. Replace https://example.com with the page you want to capture. The path sets the output filename; type explicitly requests JPEG. The example uses quality 85 and full-page capture as choices, not requirements.
Choose viewport, full-page, and JPEG quality
Capture the visible viewport
By default, Playwright captures the visible viewport. Let the file extension infer JPEG:
Free tools Windows power users keep installed
One-click scans. No signup required.
#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: 'viewport.jpg' });
A .jpg or .jpeg path is sufficient for format inference. You can include type: 'jpeg' instead or as well to make the desired format explicit.
Capture the full scrollable page
Set fullPage: true to capture the full scrollable page rather than only the current viewport:
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
await page.screenshot({
path: 'full-page.jpeg',
type: 'jpeg',
fullPage: true,
quality: 90,
});
Adjust compression quality
JPEG quality accepts values from 0 to 100; the documented default is 80. Higher values generally retain more image detail at the cost of larger files. Choose a value based on the balance you need, then check the resulting image and file size. The quality option does not apply to PNG.
Save the returned image bytes instead of writing a file
When you omit path, page.screenshot() returns a Node.js Buffer. You can pass those bytes to image-processing or storage code:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
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.
const image = await page.screenshot({ type: 'jpeg', quality: 80 });
// Pass image (a Buffer) to your processing or storage code.
If you want Playwright to write the screenshot directly to disk, include path as in the earlier examples.
Understand format and transparency behavior
Playwright supports PNG, JPEG, and WebP. It defaults to PNG if it cannot infer or is not given a type. JPEG does not support transparent output through omitBackground; if you need transparency, choose an image format that supports it instead.
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
Keep visual-test screenshots consistent
For visual comparisons, control the execution environment as well as the screenshot options. Playwright identifies operating system, browser version, settings, hardware, power source, and headless mode as factors that can change rendering. Its screenshot assertion workflow takes repeated captures until two consecutive screenshots match. A consistent setup and that repeated-capture behavior help avoid treating a transient or environment-driven difference as a real page change.
Troubleshoot common JPEG capture problems
- The file is PNG instead of JPEG: Use a
.jpgor.jpegoutput path, or explicitly settype: 'jpeg'. - The image shows only the top of the page: The default is viewport capture. Set
fullPage: truewhen you need the full scrollable page. - The screenshot has no transparency: JPEG does not support the transparent-background behavior controlled by
omitBackground. Use an image format with transparency support if that is required. - Image comparison results vary: Check whether the operating system, browser version, settings, hardware, power source, or headless mode differs between runs; these can affect rendered output.
- You need the image in memory rather than on disk: Omit
pathand use the returnedBuffer.
Or skip the browser setup
ScreenshotNeo offers a website screenshot API: one GET request with a URL returns an image or PDF. Cookie banners are accepted and removed, along with known newsletter popups and chat widgets, before capture; these cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server lets AI agents use screenshot tools, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000.
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 →For API options and behavior, see the ScreenshotNeo documentation. Example cURL request:
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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
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.

