Recommended Free Tools
The html-to-image npm package turns a live browser DOM node into an image or related output: PNG, JPEG, SVG, Blob, Canvas, or raw pixel data. Install it with npm i html-to-image, then pass an element such as a card or chart to the function that matches what your app needs. It is a browser-side DOM renderer, not a Node.js tool for taking a screenshot of an arbitrary URL.
What html-to-image does—and where it runs
html-to-image generates an image from a DOM node using browser HTML, SVG, and canvas capabilities. You provide an element already present in the page; the library reconstructs its content and styles for rendering. It is useful for exporting a chart, profile card, invoice, or other section of a web application.
The distinction matters for server-side code. This package expects a browser DOM node. It does not accept a URL or a string of HTML and launch a browser in Node.js. For a Node.js workflow that renders HTML through a headless browser, node-html-to-image describes a Puppeteer-based approach. The right choice depends on where the content is and whether a browser is already rendering it.
Install the npm package
From your project directory, run:
npm i html-to-image
The project README also documents npm install --save html-to-image. Use the package manager and lockfile conventions already used by your project. The package supports ES module imports and CommonJS-style require.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute#1 Best Overall
- 【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
Capture a DOM element as PNG
In a browser application, select the target node and pass it to toPng. A React component can keep the node in a ref, as shown in the project README.
import * as htmlToImage from 'html-to-image';
const node = document.getElementById('export-card');
if (!node) {
throw new Error('Could not find #export-card');
}
htmlToImage.toPng(node)
.then((dataUrl) => {
const link = document.createElement('a');
link.download = 'card.png';
link.href = dataUrl;
link.click();
})
.catch((error) => {
console.error('Could not export the card:', error);
});
This code runs in a page where document exists and the target element has been rendered. In a React app, trigger the capture after the component and its assets have rendered, and pass the element stored in the ref rather than querying for an element before it exists.
Choose the output type
The documented methods return different things, so choose based on the next step in your app—not just the file extension you want.
Rank #2
- [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.
| Method | Result | When it fits |
|---|---|---|
toPng(node) |
PNG data URL | Display an image in the page or download a lossless raster image. |
toJpeg(node, options) |
JPEG data URL | Produce a compressed photographic image; the documented quality option ranges from 0 to 1 and defaults to 1.0. |
toSvg(node) |
SVG data URL | Keep the serialized rendering in SVG form where that output is suitable. |
toBlob(node) |
Image Blob |
Pass image data to browser APIs that accept a Blob or create an object URL. |
toCanvas(node) |
HTMLCanvasElement |
Continue working with the rendered canvas in the browser. |
toPixelData(node) |
Uint8Array containing RGBA pixel data |
Consume pixel values in code that needs raw image data. |
For a PNG download, a data URL is convenient. For APIs that accept binary data, a Blob is generally the more direct result. If you need to inspect or manipulate pixels, use the pixel-data method or canvas output. The library’s function names and return types are documented in its project README.
Options for sizing, appearance, and asset handling
Options let you adjust the output without changing the source node. The README documents these options; check its current API description for the exact shape accepted by your installed version.
filter: exclude a node from the capture. Excluding a node also excludes its children, and the filter is not called on the root node itself.backgroundColor: set a background color for the rendered result.widthandheight: set dimensions used for the cloned node.canvasWidthandcanvasHeight: set the canvas dimensions separately from the node dimensions.style: apply style changes for the rendering.quality: set JPEG quality from 0 to 1; the documented default is 1.0.pixelRatio: adjust the pixel ratio used in rendering.cacheBustandincludeQueryParams: influence resource URL handling while assets are fetched.imagePlaceholder: provide a placeholder for image resources.- Preferred font format: choose the font format to embed where supported by the documented options.
For example, this capture omits elements matched by a predicate and sets a white background:
Rank #3
- 【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.
htmlToImage.toPng(node, {
backgroundColor: '#ffffff',
filter: (element) => !element.classList?.contains('no-export'),
pixelRatio: 2,
}).then((dataUrl) => {
document.querySelector('#preview').src = dataUrl;
});
In this example, a node with the no-export class is excluded along with its descendants. The root element is not passed to filter, so put the exclusion class on a child if the root should remain in the capture. Higher pixel ratios increase output resolution and may increase the amount of rendering work and memory required.
How rendering works, and why captures can differ
The library does more than take a direct bitmap of the visible screen. Its documented process clones the element tree, copies computed styles, recreates pseudo-elements, embeds fonts and images, serializes the clone, wraps it in SVG using <foreignObject>, and draws raster output or pixel data through an off-screen canvas.
That reconstruction explains why a capture may differ from what you see. A font or image that cannot be loaded or embedded may be missing; styles that depend on browser behavior may render differently; and canvas security rules can block readback. Keep the element and required assets available to the page, and verify the result in the browser where the application will run.
Rank #4
- 【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.
Browser support and practical limits
The project README requires Promise and SVG <foreignObject> support. It reports testing on latest Chrome, Firefox, and Safari as versions 49, 45, and 16 respectively “at the time of writing.” Those version numbers are historical documentation, not proof of current browser coverage. The README says Internet Explorer is unsupported because it does not support SVG <foreignObject>.
A canvas inside the captured node may render, but a tainted canvas can prevent successful rendering. Very large DOM trees may also exceed data-URI limits, which vary; the README gives no universal size threshold. If a large capture fails, reduce the captured content or output dimensions and test the actual target browser rather than relying on a presumed limit.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common problems and fixes
- The node is missing or capture starts too early: ensure the element exists before calling the method. In component frameworks, trigger capture only after the relevant render has completed.
- An image or font is absent: check that the asset is reachable and can be embedded in the rendering context. Confirm that it has loaded before capture; use the documented placeholder option if a fallback image is appropriate.
- The promise rejects around a canvas: check whether a canvas in the captured subtree is tainted by cross-origin content. The README warns that taint can prevent rendering; browser canvas security, rather than the output method alone, may be the cause.
- Styles or pseudo-elements look different: remember that the library reconstructs the node from computed styles and serialized markup. Inspect the relevant computed styles and pseudo-element content, then simplify or explicitly set styles for the exported version.
- A huge capture fails or stalls: try a smaller subtree or smaller dimensions. Data URI size limits vary, and the README does not specify a cutoff.
- It fails in a browser you support: confirm Promise and SVG
<foreignObject>support in that browser. The project’s historical tested-version note should not be treated as a current compatibility guarantee.
Or skip the browser setup
If your actual task is to capture a public website by URL rather than export a DOM node already in your app, use a screenshot API instead of wiring this browser library into a page. ScreenshotNeo accepts one GET request with a URL and can return PNG, JPEG, WebP, or PDF. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; those cleanup steps can each be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and 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 problemsOne-call cURL example:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. One thousand screenshots per month are free with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo and start with 1,000 free screenshots a month, no card required.
Best Value
- AV TO USB Converter: Capture videos and audios from VHS, VCR, Hi8, DV tapes to a PC, with the help of our USB Video Converter. Save room while digitizing your favorite old memories
- Quality Capture Card: Our USB Video Capture Card converting anolog RCA composite input into HD 720P USB output and capturing audio without any sound card. Advanced signal processing technology provides you with great precision, colors, resolutions, and details.
- Plug and Play: Automatically install the driver once you hook up this RCA to USB Converter to a PC. No external power is needed. User-friendly and easy to operate
- Wide Compatibility: The Video Capture Card can work with video devices with RCA connector or S-Video connector, such as VHS, VCR, Hi8, camcorder, compatible with Windows and Mac OS. Support video formats like NTSC, PAL, and support brightness, contrast, hue, and saturation control
- Note: The Video Converter is used with acquisition software. We recommend OBS Studio or PotPlayer for Windows, and QuickTime Player for Mac. They can be downloaded for free online. Please operate according to the steps in User Manual or contact us if you have any questions
Should you use html-to-image?
Use html-to-image when your application already has the DOM node to export and the capture belongs in the browser. Choose among its data URL, Blob, Canvas, SVG, or pixel-data outputs according to what consumes the result. If the input is instead a URL or HTML rendered on a server, use a workflow built for headless browser rendering or a hosted screenshot service; those solve a different problem.
Frequently Asked Questions
Can html-to-image capture an arbitrary website URL?
No. Its documented API takes a DOM node in a browser page; it is not a URL screenshot endpoint.
Does html-to-image require React?
No. React refs are one documented usage pattern, but the library operates on a DOM node and can be used without React.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Can it create a PDF?
The documented output methods are image data, SVG, Blob, Canvas, or pixel data; PDF is not among the listed methods.
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.




