Choose PNG for crisp text, pixel-diff baselines, or transparency; choose JPEG for photographic screenshots when smaller files matter more than perfect edges; choose WebP when your downstream tools support it and you want modern compression with a quality setting. In Puppeteer 25.12.0, PNG is the documented default, but set type explicitly in CI so your output format is intentional.
Which Puppeteer screenshot format should you use?
| Your need | Choose | Why | Trade-off |
|---|---|---|---|
| Visual-regression baselines or precise UI/text capture | PNG | Lossless edges and text; no quality tuning | Files are generally larger |
| Photos, gradients, or bandwidth-sensitive artifacts | JPEG | Lossy compression can reduce file size; quality is configurable from 0 to 100 | May blur or introduce artifacts around text and sharp edges; does not support transparency |
| Compressed output for compatible consumers | WebP | Modern compression with configurable quality from 0 to 100 | Check compatibility in every viewer, diff tool, and CI artifact browser you use |
| Transparent logo or composited UI asset | PNG with omitBackground: true |
Can preserve a transparent background when the capture path supports it | Confirm transparency in the resulting image and in downstream tools |
Puppeteer 25.12.0 documents png, jpeg, and webp as its screenshot formats, with PNG as the default. Puppeteer ScreenshotOptions documents that quality ranges from 0 to 100 and does not apply to PNG.
Set the format explicitly in code
For a file capture, set both the filename extension and type. Puppeteer can infer the type from a supplied path’s extension, but explicitly setting it makes intent clear and avoids relying on inference in a test pipeline.
await page.screenshot({ path: 'baseline.png', type: 'png' });
await page.screenshot({ path: 'photo.jpg', type: 'jpeg', quality: 82 });
await page.screenshot({ path: 'artifact.webp', type: 'webp', quality: 80 });
Quality is a lossy-compression control for JPEG and WebP, not a universal “sharpness” setting. A lower value can shrink an image while making artifacts more visible; a higher value retains more detail but may yield a larger file. The exact size and appearance depend on the page content and capture, so inspect representative pages rather than assuming one setting suits every artifact.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Complete Node.js example
This example uses the Puppeteer package, opens a page, captures each format, and closes the browser even if capture fails. Install Puppeteer in your project with npm install puppeteer; its package manages a compatible browser download.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 900 });
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.screenshot({ path: 'baseline.png', type: 'png' });
await page.screenshot({ path: 'photo.jpg', type: 'jpeg', quality: 82 });
await page.screenshot({ path: 'artifact.webp', type: 'webp', quality: 80 });
} finally {
await browser.close();
}
})().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Use a stable test page and consistent viewport when comparing formats. A difference between two artifacts can come from page state, fonts, browser rendering, viewport, or timing—not just the image type.
PNG for visual tests and transparent assets
PNG is the safest default when the image itself is evidence in a visual test: its lossless encoding avoids compression changes to text edges and thin lines. That makes it a sensible choice for pixel-diff baselines, where even small changes can trigger a difference. PNG does not take a quality value; remove that option rather than expecting it to tune PNG size.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
To capture a transparent background, use PNG and ask Puppeteer to omit its default white background:
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 →await page.screenshot({
path: 'overlay.png',
type: 'png',
omitBackground: true
});
Puppeteer’s ScreenshotOptions documentation says omitBackground hides the default white background and allows screenshots with transparency. Transparency still depends on the page and capture path: a page that paints an opaque background will remain opaque. Verify the output’s alpha channel and the behavior of the image viewer or compositing tool that consumes it.
JPEG or WebP when size matters
Use JPEG for broadly consumable photographic output
JPEG is a practical choice for photo-heavy screenshots or when smaller files matter more than lossless UI edges. Set a quality value from 0 to 100 and inspect the result at its intended display size. Compression artifacts may be especially noticeable around small text, icons, and high-contrast boundaries, so JPEG is a poor default for exact visual comparisons.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
await page.screenshot({ path: 'photo.jpg', type: 'jpeg', quality: 82 });
Use WebP when every consumer accepts it
WebP offers a modern compressed format with the same documented 0–100 quality range. It is appropriate when your storage, review, and CI tooling all handle WebP correctly. Confirm that every artifact viewer and image-diff tool in the path can decode it; compatibility is a workflow decision, not just a Puppeteer setting.
await page.screenshot({ path: 'artifact.webp', type: 'webp', quality: 80 });
There is no universally best numeric quality setting in the API documentation. Choose it by checking the file-size and fidelity trade-off on your own representative screenshots.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesFormat is separate from what Puppeteer captures
Image type controls encoding; capture scope and page preparation are separate options. The Puppeteer Page.screenshot API covers screenshot capture, while ScreenshotOptions documents the relevant settings.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
fullPage: truecaptures the full document instead of only the viewport. Very long pages can create tall, memory-intensive artifacts; image format does not limit the page dimensions.- Element screenshots target a rendered element rather than the whole page. Use this when the test concerns a component and not unrelated content around it.
omitBackground: trueaffects the page background and possible transparency, not the image format by itself.- Lazy-loaded images and other content may not be ready merely because the screenshot call has begun. Prepare the page and wait for the content your test needs before capturing.
For a full-page PNG:
await page.screenshot({ path: 'long-page.png', type: 'png', fullPage: true });
Full-page capture changes image dimensions and can expose page-length, loading, or artifact-handling issues. If your CI system previews only a small portion of a tall image, consider whether a viewport or element capture better matches the test.
Make visual-regression artifacts repeatable
- Fix the viewport. Set width and height before navigation or capture so responsive layout changes do not masquerade as format differences.
- Wait for meaningful readiness. Choose a navigation and application-ready condition suited to the page. Network-idle conditions can be unsuitable for sites with persistent requests; in those cases wait for a known selector or state.
- Stabilize dynamic content. Use test data and suppress or control animations, clocks, rotating content, and other sources of nondeterminism where your test setup permits.
- Choose one format for the baseline and comparisons. For pixel-level comparisons, PNG avoids lossy encoding as a source of differences.
- Record capture settings with the artifact. Keep the viewport, browser setup, relevant page state, and screenshot options consistent between baseline generation and later runs.
- Set
typeexplicitly. Do not rely on a library default or path inference to communicate the test’s intended format.
Common problems and fixes
- “Quality” has no effect on PNG: that is expected; Puppeteer documents quality as inapplicable to PNG. Use JPEG or WebP if you need lossy compression, or keep PNG for fidelity.
- The saved type is unexpected: when a
pathis provided, Puppeteer infers screenshot type from the extension. Make the extension and explicittypeagree, such asshot.webpwithtype: 'webp'. - WebP will not open in CI or a diff tool: check decoder support at every point where the artifact is previewed or compared. If a consumer cannot handle WebP, use PNG or JPEG for that workflow.
- A supposedly transparent PNG has a solid background: use
omitBackground: true, confirm the page does not paint an opaque background, and inspect alpha-channel support in the viewer. - Text looks fuzzy in a smaller file: lossy JPEG or WebP compression can affect sharp edges. Raise quality or switch to PNG, especially for small UI text and visual baselines.
- A full-page capture is unexpectedly huge or unwieldy: full-page mode captures the document, not a fixed viewport. Capture only the needed element or viewport when that better matches the test.
- Images or page content are missing: wait for the content required by the test before calling
screenshot(); lazy-loaded content may need scrolling or another deliberate readiness step.
Or skip the browser setup
If you need an endpoint rather than maintaining a Puppeteer browser flow, ScreenshotNeo returns a screenshot or PDF from one GET request. Its API also accepts output-format and capture options. See the ScreenshotNeo API documentation for the current parameters. For example, this cURL command saves a WebP capture:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes supported cookie/consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. An MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. Sign up for free.
Recommended Free Tools
Frequently Asked Questions
Does Puppeteer support AVIF screenshots?
The documented screenshot image formats in Puppeteer 25.12.0 are PNG, JPEG, and WebP; AVIF is not listed.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Can I use screenshot quality with PNG?
No. Puppeteer documents the 0–100 quality option as inapplicable to PNG.
Which format should I use if I do not control the viewer?
PNG is the conservative option for faithful UI capture; confirm format support with the actual artifact viewer or test tooling before adopting WebP.
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.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →

