Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallTo convert HTML to PNG or JPEG, render it in a browser and save a screenshot in the format you want. With Playwright, load either a web page or an HTML string, then call page.screenshot() with type: "png" or type: "jpeg". Choose viewport, full-page, or element capture to control what appears in the image.
What “convert HTML to an image” means
HTML describes a page; it does not by itself specify the pixels you see on screen. A browser must interpret the markup, apply CSS, load images and fonts, and render the result before a screenshot can capture it. Browser automation is therefore the practical route for converting a URL or an HTML document into PNG or JPEG.
The examples below use Playwright’s JavaScript API. The same general approach works with other browser automation libraries, including Puppeteer. Playwright’s screenshot API supports PNG, JPEG, and WebP. Playwright Page API
Choose PNG or JPEG
| Format | Best for | Trade-offs |
|---|---|---|
| PNG | Text, diagrams, interface screenshots, sharp edges, and images that need lossless output. | Usually larger than a compressed JPEG for photographic content. Playwright’s screenshot quality option does not apply to PNG. |
| JPEG | Photographs and other images where a smaller, lossy file is acceptable. | Compression can soften text and introduce artifacts. Set a quality value from 0 to 100; transparent-background capture does not apply to JPEG. |
If you need transparency, choose PNG and use the documented omit-background option where appropriate. JPEG cannot preserve transparency. The output extension should match the selected format so other software can recognize the file.
#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.
Convert a URL to PNG or JPEG with Playwright
Install Playwright in a Node.js project, install its browser, and create a script. The official Playwright setup instructions explain installation and browser setup; the exact browser-installation requirements depend on your operating system and project configuration.
-
Create a project and install Playwright:
npm init -y
npm install playwright
npx playwright install chromium -
Save the following as
capture-url.js. Changeurl,format, and output filename to suit your page.const { chromium } = require('playwright'); (async () => { const browser = await chromium.launch({ headless: true }); try { const page = await browser.newPage({ viewport: { width: 1440, height: 900 } }); await page.goto('https://example.com', { waitUntil: 'networkidle' }); await page.screenshot({ path: 'page.png', type: 'png', fullPage: true }); } finally { await browser.close(); } })(); -
Run it with
node capture-url.js. For JPEG, usepath: 'page.jpg',type: 'jpeg', and optionallyquality: 80.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.
This example uses networkidle to wait for network activity to settle, but it is not a universal signal that every site is visually ready. Some pages poll continuously; others display content after a particular event or delay. For those pages, wait for a meaningful selector or an application-specific ready state before taking the screenshot.
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.
Capture the viewport, full page, or one element
- Viewport: omit
fullPageor set it tofalse. The image covers the current visible viewport. - Full page: set
fullPage: trueto capture the full scrollable page. - One element: locate it and take a screenshot of that locator, for example
await page.locator('.invoice').screenshot({ path: 'invoice.png' }).
Set the viewport before navigation or capture if the page layout depends on screen width. A full-page capture can be much taller and larger than a viewport image; check the resulting pixel dimensions and file size if another system has size limits. Playwright documents screenshot scope and options.
Set JPEG quality and pixel scale
JPEG supports a quality setting; higher values generally retain more detail while producing larger files. Quality is not relevant to PNG. Screenshot dimensions also depend on the page viewport and device scale factor. For a higher-resolution capture, configure a larger device scale factor when creating the browser context or page; expect more pixels and potentially a larger output file. The Playwright CLI also documents a high-resolution option. Playwright CLI screenshot guide
Render an HTML string instead of visiting a URL
When your input is markup stored in a string or file, use Playwright’s page.setContent() to load it into a browser page, then take a screenshot. If the HTML references external CSS, images, or fonts, those resources must be reachable from the browser; relative URLs need a meaningful base URL or absolute paths.
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 problemsconst { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({ headless: true });
try {
const page = await browser.newPage({ viewport: { width: 1200, height: 800 } });
const html = `
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
body { font: 18px Arial, sans-serif; padding: 32px; }
h1 { color: #1a5; }
</style>
</head>
<body><h1>Rendered HTML</h1><p>Saved as an image.</p></body>
</html>`;
await page.setContent(html, { waitUntil: 'load' });
await page.screenshot({ path: 'html-output.png', type: 'png', fullPage: true });
} finally {
await browser.close();
}
})();
For a JPEG, change the output name and screenshot options to { path: 'html-output.jpg', type: 'jpeg', quality: 85 }. For larger documents or external assets, wait for the specific content that must appear rather than assuming the initial load event means every visual asset is ready. The Page API documents both navigation and setting page content.
Use the Playwright command line
Playwright’s CLI can capture a URL without writing a JavaScript script. The screenshot guide documents format selection, filename, full-page capture, and high-resolution options. PNG is the default when neither the type option nor filename extension selects another format. Screenshots & PDF CLI guide
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.
npx playwright screenshot --full-page --filename=page.png https://example.com
To request JPEG, use a JPEG filename and the CLI’s format option supported by your installed CLI version. Check npx playwright screenshot --help for the exact flags available in that version. The CLI and API approach differ mainly in how you run the capture: the API is easier to extend with waits, selectors, and application logic, while the CLI is convenient for a one-off URL capture.
Other ways to produce a screenshot
Puppeteer also exposes browser screenshot options, including format and capture configuration; see its ScreenshotOptions reference. Browser automation gives control over the rendering context, waits, and capture scope. A hosted screenshot API can avoid installing and maintaining a browser locally, which is useful for automated workflows or server-side jobs.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. For a URL capture, send one GET request. The example saves a WebP image; change the requested output option as described in the ScreenshotNeo documentation if you need PNG or JPEG.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for free and get 1,000 screenshots a month with no card.
Make captures reliable and manageable
Wait for the content you actually need
Lazy-loaded images may not appear until the page is scrolled. If you need them in a full-page screenshot, ensure the page has triggered their loading before capture. For dynamic pages, use a selector that identifies the finished content, or a delay when the page offers no reliable readiness signal. There is no single wait strategy that guarantees identical results across sites.
Control what the browser renders
- Choose a fixed viewport so responsive breakpoints produce predictable layouts.
- Use a known browser context and device scale factor when pixel dimensions matter.
- Confirm fonts, images, and stylesheets have loaded, especially when the HTML references remote resources.
- Use an element screenshot when only a component matters; it avoids capturing unrelated page content.
Consider runtime, size, and cost
Launching a browser and rendering a page takes more work than simply changing a file extension: page scripts, network requests, fonts, and images all affect completion time. Full-page and high-resolution images contain more pixels and can consume more memory and storage. For repeated captures, reuse a browser process where appropriate and close pages and contexts when finished. If captures run on a server, account for browser installation, available memory, timeouts, and the page’s own loading behavior.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →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
Local Playwright and Puppeteer avoid a per-shot hosted-service charge but require you to operate the browser environment. Hosted APIs reduce browser setup and can offer service-specific billing and capture features; compare their current documentation and terms before choosing. The Playwright documentation cited here describes capture behavior, not hosted conversion-service pricing or privacy terms.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting HTML-to-image captures
The output file is empty or missing
Check that the script reached the screenshot call and that the destination directory exists and is writable. Keep the await on page.screenshot(); otherwise the process may end before the file is written. Confirm that the process did not fail earlier while launching the browser or navigating.
The page is blank or incomplete
Confirm the URL loads in the same browser environment and that required authentication, cookies, or headers are present. A navigation event can complete before an app finishes rendering. Wait for a visible page element or app-ready condition; inspect whether scripts or external resources failed.
Images, fonts, or CSS are missing
For markup loaded with setContent(), check that remote resources are accessible and that relative asset paths resolve. Use absolute URLs or provide a suitable base URL. Wait for the particular image or font-dependent content to be ready before capture.
Recommended Free Tools
The image is cropped
A default screenshot captures the viewport, not necessarily the full page. Set fullPage: true for the full scrollable document, or take a locator screenshot for a specific element. Verify the viewport width and height if responsive layout or clipping is unexpected.
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.
JPEG quality has no effect or the background is not transparent
Quality applies to JPEG, not PNG. Transparent-background capture is not applicable to JPEG; use PNG when transparency is needed and configure the background behavior supported by the API.
The script hangs while waiting
A page with continuous network activity may never become idle. Replace a broad network-idle wait with a selector or application-specific readiness check, and set an appropriate timeout. Conversely, if a page uses delayed rendering, a short fixed delay may help but is less robust than waiting for the content itself.
Frequently asked questions
Can I convert HTML to an image without opening a visible browser window?
Yes. The Playwright example launches Chromium in headless mode, so it renders the page without displaying a browser window on your desktop.
Can I save a screenshot as WebP?
Yes. Playwright’s Page screenshot API supports WebP in addition to PNG and JPEG. Check the API documentation for the options applicable to your installed version.
Will the same HTML always produce identical pixels?
Not necessarily. Browser version, fonts, viewport, device scale factor, external assets, page timing, and dynamic content can affect the rendered result. Fix the environment and readiness conditions when repeatability matters.
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.

