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

Render the HTML in a browser, then save the rendered page as an image. For a one-off PNG, Chrome Headless can do it from the command line. For reusable scripts, exact JPEG or PNG selection, full-page captures, quality controls, and high-resolution output, Playwright is the most flexible route. Puppeteer provides a similar JavaScript workflow.

This guide covers viewport and full-page screenshots, timing, image format, compression, scale, transparency limits, troubleshooting, and a no-browser-setup option using ScreenshotNeo.

Choose the capture method

Method Best for Format control Full-page support
Chrome Headless A quick command-line PNG PNG output from the documented screenshot flag Use browser options and page layout appropriate to your Chrome version
Playwright Production scripts and explicit JPEG/PNG settings PNG by default; JPEG through the file extension or type, with quality from 0–100 fullPage: true
Puppeteer Node.js projects already using Puppeteer PNG by default; JPEG through screenshot options fullPage: true

The browser must render HTML before an image can represent it. If you have a local file, navigate to its file:// URL or serve it from a local web server. If you have a public page, navigate directly to its HTTPS URL.

Understand viewport versus full-page screenshots

Viewport capture

A normal screenshot records the visible browser viewport. Content below the fold is not included. This is appropriate for a hero section, a dashboard at a known size, or a visual regression check at a fixed viewport.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS
  • 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
  • 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
  • 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
  • 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
  • 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0

Full-page capture

A full-page screenshot captures the page’s scrollable content, including sections below the fold. In Playwright and Puppeteer, set fullPage: true. Long pages can create very large image files, and lazy-loaded content may not appear until it has been scrolled into view or otherwise triggered.

Fastest route: Chrome Headless PNG

Chrome’s documented command-line screenshot flag writes a PNG named screenshot.png in the current working directory.

  1. Install a current Chrome or Chromium build that supports Headless mode.
  2. Open a terminal in the folder where you want the output.
  3. Run the command below, replacing the URL.
google-chrome --headless --screenshot https://example.com

On systems where the executable is named differently, use chrome, chromium, or the full path to your browser binary. To control the viewport dimensions, add --window-size=1440,900:

google-chrome --headless --window-size=1440,900 --screenshot https://example.com

Chrome also documents --timeout as a maximum wait before capture when content is still loading. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
google-chrome --headless --timeout=10000 --screenshot https://example.com

This route is intentionally simple: the documented flag produces PNG. If you need deliberate JPEG output, quality, device scale, element selection, or a repeatable readiness strategy, use an automation API.

Playwright: convert HTML to PNG or JPEG

Install Playwright

In a Node.js project, install the library and its browser binaries:

npm install playwright
npx playwright install chromium

Capture a public URL

Create screenshot.mjs:

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage({
  viewport: { width: 1440, height: 900 },
  deviceScaleFactor: 1
});

await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await page.screenshot({ path: 'page.png' });
await browser.close();

Run it with node screenshot.mjs. The output is PNG because the path ends in .png. Playwright’s Page API says the screenshot type is inferred from the file extension when no type is specified, and PNG is the default.

Rank #2
Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P60FPS HDMI Capture Card for Streaming, Gaming, Video Recording Compatible with Switch, Xbox, PS4/5, OBS,iPad Mac OS Windows,Camera, Zoom(Silver)
  • 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
  • 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
  • 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
  • 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
  • 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.

Capture JPEG with quality control

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await page.screenshot({
  path: 'page.jpg',
  type: 'jpeg',
  quality: 85
});
await browser.close();

Playwright documents JPEG quality as a lossy-compression setting from 0 to 100, with a default of 80. It does not apply to PNG. Lower values generally reduce file size while introducing more visible compression; choose a value by inspecting text, gradients, and photographic detail in your own output.

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

Capture the complete page

await page.screenshot({
  path: 'complete-page.png',
  fullPage: true
});

Use this after the page has loaded the content you need. A full-page option does not make an application finish rendering, load every lazy image, or wait for a particular API response by itself.

Wait for the actual visual state

Navigation completion and visual readiness are different. Wait for a meaningful selector when possible:

await page.goto('https://example.com/report', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('#report-chart', { state: 'visible', timeout: 30000 });
await page.screenshot({ path: 'report.png', fullPage: true });

If the site has a known animation or delayed asset, a short explicit delay can be more predictable than guessing:

await page.waitForTimeout(1000);

Network-idle conditions can help on pages that make a finite set of requests, but they are not correct for every dynamic site. Analytics, WebSockets, polling, and ads can keep a page active indefinitely. Choose a readiness signal tied to the content you want to capture.

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

Capture an element instead of the page

const card = page.locator('.invoice-card');
await card.screenshot({ path: 'invoice-card.jpg', type: 'jpeg', quality: 90 });

Element capture is useful for a component, chart, receipt, or preview. Make sure the selector is unique and visible before taking the shot.

Use CSS pixels or device pixels deliberately

Screenshot scale determines output resolution. A CSS-pixel capture aims for one output pixel per CSS pixel. Device-pixel capture follows the device scale factor and produces a higher-resolution image, usually with a larger file. Set the factor when creating the page:

Rank #3
Capture Card, 4K HDMI Video Capture Card, Game Capture Card, 1080P 60FPS Video Capture Device, HDMI to USB 3.0 Capture Card for Streaming, Work with Camera/Xbox/PS4/PS5/PC/OBS
  • 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
  • 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
  • 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
  • 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
  • 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.
const page = await browser.newPage({
  viewport: { width: 1280, height: 800 },
  deviceScaleFactor: 2
});

Use a factor of 1 for predictable dimensions and smaller files; use 2 or another value when the image will be displayed at high density. Record the viewport and scale alongside generated assets so later captures are comparable.

Transparent backgrounds

For PNG, Playwright can omit the default background:

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.
await page.screenshot({ path: 'transparent.png', omitBackground: true });

omitBackground does not apply to JPEG. JPEG cannot carry transparency, so use PNG when transparent pixels matter.

Capture local HTML

For a local document, use an absolute file URL:

import { chromium } from 'playwright';
import path from 'node:path';
import { pathToFileURL } from 'node:url';

const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1200, height: 800 } });
const fileUrl = pathToFileURL(path.resolve('index.html')).href;
await page.goto(fileUrl, { waitUntil: 'load' });
await page.screenshot({ path: 'index.png', fullPage: true });
await browser.close();

If the page depends on module imports, fonts, APIs, or relative assets that do not work from file://, serve the folder locally instead, for example with your project’s development server, and navigate to its http://localhost address.

Puppeteer alternative for Node.js

Puppeteer’s official screenshot guide uses browser navigation followed by page.screenshot(). A reusable JPEG example is:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 900 });
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.screenshot({
  path: 'page.jpg',
  type: 'jpeg',
  quality: 85,
  fullPage: true
});
await browser.close();

networkidle2 waits until network activity is relatively quiet, but the right condition depends on the site. Replace it with a selector wait or a bounded delay when pages poll continuously or render content after navigation.

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

Format, dimensions, and readiness decisions

PNG or JPEG?

  • Choose PNG for interface screenshots, text, diagrams, transparency, and lossless detail. It is the documented default in Playwright.
  • Choose JPEG for photographs or when a smaller lossy image is acceptable. Set and document a quality value; JPEG has no transparency.

How large should the image be?

Set the viewport to the layout you need to represent, then choose the device scale factor based on output resolution. A 1440-pixel-wide viewport at scale 1 and scale 2 have different pixel dimensions even though the CSS layout is the same.

Rank #4
Audio Express AXHDCAP 4K HDMI Video Capture Card, Cam Link Card Game Audio Adapter HDMI to USB 2.0 Record Capture Device for Streaming, Live Broadcasting, Video Conference, Teaching, Gaming
  • [Enhanced 4K-1080P Video Capture Experience] Capture the Magic: Elevate your video recordings to new heights with our upgraded anti-static 1080P Video Capture Card. Immerse yourself in stunning visuals, supporting HDMI input at 4K 60FPS and USB output for capturing in 1080P, complete with rich stereo sound. Enjoy crystal-clear video recordings, dynamic gaming live streams, and professional conference broadcasts. Note: HDMI resolution: Max input can be 3840×2160@30Hz / Video output resolution: Max output can be 1920×1080@30Hz
  • [Seamless Real-Time Preview] Stay in the Moment: Our advanced ultra-low latency technology ensures seamless real-time transmission of video streams. Experience instant, lag-free previews, allowing you to capture every detail precisely. Effortlessly record video directly to your hard disk, all without compromising on quality or introducing any delays.
  • [Versatility and Broad Compatibility] Your Creative Hub: Connect your DSLR, camcorder, or action camera to a wide range of operating systems, including Windows, MacOS, and Linux. Unlock a world of possibilities with real-time streaming to popular platforms like Twitch, Youtube, OBS, Zoom, Potplayer, and VLC, giving you the tools to share your content effortlessly.
  • [Effortless Plug and Play] Simplicity Redefined: Say goodbye to complex installations. Our plug-and-play design eliminates the need for drivers or external power supplies. Seamlessly integrate high-definition acquisition into various scenarios, whether it's educational recordings, immersive gaming, precise medical imaging, captivating live streams, or professional broadcasting.
  • [Seize Every Detail with Precision] Unleash your creativity and attention to detail with our video capture card. Capture every nuance, every color, and every moment with precision, thanks to the enhanced capabilities of our technology. Whether you're a content creator, a gamer, or a professional, our capture card empowers you to seize the finest elements and bring them to life in your recordings and live streams.

When is the page ready?

  • Wait for a selector that proves the target component exists.
  • Wait for fonts, charts, or images that are known to arrive after navigation.
  • Use a bounded timeout so a broken page cannot hold a job forever.
  • For full-page captures, account for lazy loading below the fold.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request returns PNG, JPEG, WebP, or PDF, while its capture process accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot. Each step can be disabled.

Only clean shots are billed: bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing. Response headers identify the page verdict and whether the request was billed. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

Using the API requires an access key. See the ScreenshotNeo documentation for parameters and authentication.

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

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)
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}`);

ScreenshotNeo also supports full-page capture, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, custom CSS and JavaScript, click actions, selector or network-idle waits, resource blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, configurable caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account to start with the included monthly shots.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common failures

The file is blank or only partly rendered

Cause: capture occurred before client-side rendering, fonts, images, or charts completed. Fix: wait for a content-specific selector, confirm the element is visible, and use a bounded delay for assets with no reliable selector.

Below-the-fold images are missing

Cause: lazy loading was never triggered. Fix: use fullPage: true and, when necessary, scroll through the page or trigger the site’s lazy-load mechanism before capturing.

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.

The output is the wrong format

Cause: the file extension or screenshot options do not match your intention. Fix: use a .png or .jpg path and set Playwright’s type explicitly when format matters. Chrome Headless’s documented quick flag is a PNG workflow.

Best Value
Sale
acer Video Capture Card HDMI to USB 3.0, 1080P 60FPS/2K 30FPS for Streaming
  • 【1080P 60FPS & 2K 30FPS】Supports HDMI input up to 4K 30FPS for ultra‑clear source signals, and captures/streams smooth footage at max 1080P 60FPS or 2K 60FPS to eliminate motion blur and stuttering, delivering fluid visuals for gaming, live streaming and video recording via high‑speed USB 3.0 transmission.
  • 【USB 3.0 High-Speed Interface】USB 3.0 interface with up to 5Gbps bandwidth for lag-free HD capture and streaming with consoles, cameras, desktops, and laptops. Aluminum casing dissipates heat effectively, ensuring stable performance under prolonged high-bandwidth loads. Note: For best results, use a USB 3.0 port.
  • 【Easy Plug-and-Play design】with no additional driver software required. The 2-in-1 USB-A & Type-C interface design ensures wide compatibility with laptops, desktops, gaming consoles and mobile devices. Its compact and lightweight construction enhances portability, allowing you to carry and use it effortlessly anytime and anywhere.
  • 【Wide Universal Compatibility】Works with diverse devices: laptops, tablets, PS4/PS5, Nintendo Switch, cameras, TV boxes, and Oculus Quest 2/3. It supports major operating systems: Windows 7/8/8.1/10, Mac OS, Linux, Android, and iPadOS 17+. Fully compatible with popular software and streaming platforms like OBS Studio, QuickTime Player, TikTok, Twitch, and YouTube—all without requiring drivers.
  • 【Worry-Free After-Sales Support】Whether you're a newcomer or a seasoned user, feel free to reach out anytime with any questions—your satisfaction is our top priority. NOTE: This capture card supports one-way transmission only (HDMI to USB), and ensure your device is equipped with a USB 3.0 port to achieve optimal performance.

JPEG has a colored or opaque background

Cause: JPEG does not support transparency, and Playwright’s omitBackground does not apply to JPEG. Fix: write a PNG when transparent pixels are required.

The browser never finishes

Cause: persistent polling, WebSockets, ads, or analytics prevent a network-idle condition. Fix: wait for the target selector instead, apply a maximum timeout, and close the browser in a cleanup path.

Local assets fail to load

Cause: relative imports or browser security behavior differ under file://. Fix: serve the directory over localhost and capture the HTTP URL.

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

Captures differ between runs

Cause: changing viewport, device scale, fonts, animations, time, or remote content. Fix: fix the viewport and scale, wait for the same readiness signal, disable or freeze animations with CSS where appropriate, and capture from a controlled browser environment. The cited browser documentation does not guarantee identical output across all browsers or websites.

Operational checklist

  • Decide whether the target is the viewport, one element, or the full scrollable page.
  • Choose PNG for lossless or transparent output; choose JPEG for lossy photographic output.
  • Set viewport dimensions and device scale explicitly.
  • Wait for the visual state that matters, not merely navigation.
  • Load or trigger content below the fold before full-page capture.
  • Use bounded timeouts and close the browser after each job.
  • Record format, quality, viewport, scale, URL, and capture time with generated assets.

Further reading

Frequently Asked Questions

Can I convert HTML to an image without opening a visible browser window?

Yes. Chrome Headless, Playwright, Puppeteer, and ScreenshotNeo perform the rendering without a visible browser window. The page still has to be rendered by a browser engine for a faithful screenshot.

Which format should I use for a website screenshot?

Use PNG for interfaces, text, diagrams, or transparency. Use JPEG when lossy compression is acceptable, especially for photographic content.

Why is my full-page screenshot unusually large?

A full-page image includes every scrollable section, and a higher device scale factor multiplies its pixel dimensions. Reduce the viewport height or scale only if those changes still meet your output requirement.

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

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.