Recommended Free Tools
“HTML to Image GitHub” most likely refers to bubkoo/html-to-image, an open-source JavaScript library that turns a DOM node in a web page into an image-related output. Its README documents PNG, SVG, JPEG, Blob, Canvas, and pixel-data functions. It is a browser-side library—not a hosted service that accepts a URL and renders a page on your behalf. That distinction is the key to deciding whether it fits your project.
What is the html-to-image GitHub project?
The bubkoo/html-to-image repository describes its project as generating an image from a DOM node using HTML5 canvas and SVG. It is a JavaScript project and a fork of dom-to-image; its maintainers describe the fork as having more maintainable code and additional features. The package is named html-to-image for npm installation.
The basic model is: your application already has an element in the browser’s DOM, and the library converts that element into a requested output. It does not, on its own, fetch a public website, run its scripts in a remote browser, or act as a general-purpose screenshot API. If your source is a page URL rather than a DOM node you control, you are looking at a different category of tool.
Which output formats and functions does it document?
| Function | Documented output | Typical reason to choose it |
|---|---|---|
toPng |
PNG image | Display or download a raster image. |
toJpeg |
JPEG image | Produce a JPEG output. |
toSvg |
SVG | Produce an SVG representation. |
toBlob |
Blob | Work with the generated image as a browser Blob. |
toCanvas |
Canvas | Continue working with a canvas result. |
toPixelData |
Pixel data | Access the rendered pixel data. |
The README documents these functions as promise-based and accepting a DOM node and rendering options. It also demonstrates showing a generated PNG, downloading PNG or JPEG, and excluding selected nodes during SVG creation. The format you choose depends on what consumes the result: a browser preview, a downloadable file, or further image processing.
#1 Best Overall
Install the npm package
The documented installation command is:
npm install --save html-to-image
Use it in a browser application where the target element exists in the DOM. The README does not establish the package as a server-side URL renderer, so do not assume that installing it gives a Node process a browser document or lets it capture arbitrary websites.
Convert a DOM element to PNG
Here is a minimal browser-side example. It waits for a user click, finds an existing element, requests a PNG data URL, and starts a download. The file name is set by the application; this example does not add a server or remote rendering step.
import { toPng } from 'html-to-image';
const button = document.querySelector('#download-card');
button.addEventListener('click', async () => {
const node = document.querySelector('#card');
if (!node) {
throw new Error('Could not find #card');
}
const dataUrl = await toPng(node);
const link = document.createElement('a');
link.download = 'card.png';
link.href = dataUrl;
link.click();
});
For a page to run this snippet, it needs an element with id="card", a button with id="download-card", and a JavaScript setup that can resolve the package import. The call returns a promise, so handle failures in the event handler if your application needs to show a user-friendly error instead of an unhandled rejection.
The rendering options documented by the README include a background color, width and height, canvas width and height, style overrides, and a filter function. For example, a white background can be requested when transparent output is not wanted:
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
const dataUrl = await toPng(node, {
backgroundColor: '#ffffff'
});
Read dimensions carefully: the README distinguishes the rendered width and height from canvas width and height. Use the appropriate option for the output size or canvas size you intend. The available documentation does not provide an independent performance or browser-compatibility matrix, so validate the result with the browsers and page content that matter to your application.
Control what appears in the output
Filter elements
The documented filter option lets you exclude nodes from the generated output. The README’s example excludes a node and its descendants, and it notes that the filter is not called on the root node. That distinction matters: if you attach the filter expecting it to remove the capture root itself, that is not the documented behavior.
Set the background and dimensions
Use the documented background color option when the output needs a deliberate solid background. Width and height and canvas width and height are separate documented settings; set them intentionally rather than assuming a CSS box size automatically determines every output dimension.
Apply style overrides
Style overrides let an export use different styles from the on-screen element. This is useful when the captured version needs presentation adjustments, but the README does not establish that every site stylesheet or visual effect will render identically in every environment. Verify the generated result rather than treating an option as a guarantee of pixel-perfect output.
Rank #3
Choose the library or a hosted renderer?
Use html-to-image when your application can supply the DOM node to convert and you want the conversion to happen as part of that browser application. A hosted renderer is a different fit when you need to submit HTML, CSS, or a public URL to a remote service, or when you want an API or service-managed integration instead of calling a DOM conversion function in your page.
| Decision point | html-to-image |
Hosted rendering API |
|---|---|---|
| Input | A DOM node in the browser. | Can accept inputs such as HTML/CSS or a URL, depending on the service. |
| Where conversion happens | In the browser application using the DOM, canvas, and SVG. | On the provider’s service. |
| Authentication and operations | The documented library usage is an npm package and DOM conversion call. | May require an API key and service-specific setup. |
| Best starting point | Your page already has the element and you want to export it. | You need remote capture or service integrations. |
html2img.com is one separate hosted service surfaced alongside the repository. Its getting-started documentation describes raw HTML/CSS rendering, screenshots of public URLs, named templates, API keys, SDKs and integrations, and PNG or PDF responses for its HTML and screenshot endpoints. These are features of that service, not of the html-to-image npm package. Its vendor GitHub organization page advertises 25 free monthly renders; that is the vendor’s offer and may change.
If your actual requirement is a website screenshot API, try ScreenshotNeo first: it removes cookie and consent banners, newsletter popups, and chat widgets before capture, and bills only clean shots. It is a remote website screenshot API and MCP server, not a replacement for a DOM-node library when you need to export an element already rendered in your own application.
Or skip the browser setup
If you need a screenshot of a URL rather than a DOM node, ScreenshotNeo returns an image or PDF from a single GET request. For example, save this cURL response as a WebP image:
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 problemscurl -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 parameters. In Python:
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
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)
In 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}`);
- Cookie banners, popups, and chat widgets are removed before the shot; each cleanup step can be turned off.
- Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers report the page verdict and billing status.
- An MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs.
- The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month without a card.
License and project status
The repository states that its scripts and documentation are released under the MIT License. Review the repository’s current license text and package state before adopting it, particularly if release timing or compatibility is a deciding factor. The npm listing available for this article displayed version 1.11.13 and described it as last published two years earlier; those are listing details observed in 2026 and can change, so check npm directly for the version and publication date current when you install.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting a DOM-to-image export
The import or package install fails
Confirm the dependency is installed in the project that builds the browser page and that your build setup can resolve an npm package import. The documented package name is html-to-image; check spelling and package-manager output before changing the import path.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →The target element is missing
Check that the selector matches an element present at the time the user triggers the export. In the example, a missing #card intentionally throws an error. If the page renders the target later, trigger the export only after it exists.
Best Value
The generated image does not match the desired size or background
Inspect the actual element and the options passed to the conversion. Set the documented background option if you need an explicit color, and distinguish width and height from canvas width and height. The README documents these controls but does not promise that they override every browser rendering difference.
Unwanted nested content appears
Use the documented filter function to exclude the relevant node and descendants. Remember the filter does not run on the root node; put the target content inside a root that you intend to capture if you need to exclude only a nested part.
You need to capture a URL or generate PDFs
That is not the library’s documented input model. It accepts a DOM node and documents image-related conversion functions, not a remote browser service. Select a hosted renderer whose documented endpoints cover your input and desired output; confirm its current terms, authentication, and format support on the provider’s own documentation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Is html-to-image the right choice?
Choose bubkoo/html-to-image when the content is already a DOM node in your web application and the documented promise-based conversion functions match the output you need. Choose a hosted API when your input is a URL or raw HTML that must be rendered remotely. These are different execution models, not competing ways to call the same tool; deciding based on input and deployment environment avoids expecting a client-side package to do server-side screenshot work.
Frequently Asked Questions
Is html-to-image the same as html2img.com?
No. html-to-image is an npm library that converts a DOM node; html2img.com is a separate hosted rendering service.
Does the GitHub project provide a server-side screenshot endpoint?
The documented project is a client-side DOM conversion library. The repository information here does not establish a hosted screenshot endpoint.
Can I use it to export only part of a page?
Yes, its documented filter option can exclude selected nodes and their descendants from a capture, subject to the root-node behavior described above.
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.

