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

If html2canvas leaves images out, first check whether they load successfully and whether they come from another origin. For cross-origin images, set useCORS: true only if the image server permits it with an appropriate Access-Control-Allow-Origin response header. If it does not, use an authorized same-origin proxy or change the image hosting path. The option cannot override browser security rules, and allowTaint: true does not make a restricted canvas exportable.

Why html2canvas leaves images out

The leading cause to check is the browser’s same-origin policy. A page may display an image from another origin in an ordinary <img> element, while the browser still prevents JavaScript from reading that image’s pixels through a canvas. html2canvas skips images that would taint the canvas when allowTaint is false. Its FAQ puts the limit plainly: “html2canvas cannot circumvent content policy restrictions set by your browser.”

Cross-origin does not simply mean a different domain name. Scheme, hostname, and port all matter when determining origin. A URL that appears to be on your site can also redirect to a CDN or other host, so inspect the final request URL rather than relying only on the URL in your markup.

Other causes produce similar symptoms. A request may fail or time out; the capture may start before an image has loaded; or the entire canvas may be blank or truncated because of canvas-size limits. Diagnose the symptom before changing options:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Snagit 2024 - Screen Capture & Image Editor [PC/Mac Online Code]
  • Easily record quick videos of your screen and camera that offer the same connection as a meeting without the calendar wrangling
  • Draw on your screen as you record video with customizable arrows, squares, and step numbers to emphasize important information
  • Provide clear feedback and explain complex concepts with easy-to-use professional mark-up tools and templates
  • Instantly create a shareable link where your viewers can leave comments and annotations or upload directly to the apps you use every day
  • Version Note: This listing is for Snagit 2024. Please note that official technical support and software updates for this version are scheduled to conclude on December 31, 2026.
  • One or a few images are missing: check the image request, redirects, and CORS permission.
  • The image URL fails to load on its own: resolve the URL, access, or server error first.
  • The whole capture is blank or cut off: investigate element dimensions and canvas limits separately from CORS.

Check the image request before changing code

  1. Open the image URL directly in the browser. Confirm that it loads and that you are testing the same URL used by the page.
  2. Open your browser’s developer tools and select the Network panel. Reload the page or reproduce the capture, then find the image request.
  3. Check its status, redirects, final URL, and response headers. For a cross-origin image, look for an appropriate Access-Control-Allow-Origin header on the response that actually serves the image.
  4. Check the console and network results for a failed request, a CORS error, or a request that is still pending when capture begins.

An image rendering in the page is not proof that canvas code can read it. The page may be allowed to display a cross-origin image without being allowed to export its pixels.

Redirects deserve special attention. One report in the html2canvas project describes a same-origin image URL redirecting to a CDN, with CORS mode not applied because the initial URL appeared same-origin. Treat this as a possible edge case, not a rule for every redirect: inspect the destination and its headers, then test the actual capture path.

Fix cross-origin images when the image server supports CORS

Pass useCORS: true to html2canvas. This asks the library to attempt CORS-enabled image loading; it does not change the remote server’s policy.

const element = document.querySelector("#capture");

if (!element) {
  throw new Error("Capture element #capture was not found");
}

try {
  const canvas = await html2canvas(element, {
    useCORS: true
  });

  const image = canvas.toDataURL("image/png");
  const link = document.createElement("a");
  link.href = image;
  link.download = "capture.png";
  link.click();
} catch (error) {
  console.error("html2canvas capture failed:", error);
}

This example assumes html2canvas is already loaded and that it runs in a browser environment supporting the shown JavaScript syntax. The relevant configuration option is useCORS; verify it against the version installed in your project if you are using version-specific setup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Screen recorder software for PC – record videos and take screenshots from your computer screen – compatible with Windows 11, 10, 8, 7
  • Record videos and take screenshots of your computer screen including sound
  • Highlight the movement of your mouse
  • Record your webcam and insert it into your screen video
  • Edit your recording easily
  • Perfect for video tutorials, gaming videos, online classes and more

The image host must send a suitable Access-Control-Allow-Origin header for the requesting page. Inspect the response in Network tools; do not infer permission from the fact that the image is visible. If you control the image server, configure its CORS policy to allow the origin that hosts the page. If you do not control it, ask the provider about supported cross-origin access or use an authorized proxy.

Use a controlled proxy when the image host cannot grant access

The documented alternative is to retrieve the image through a proxy so the browser can load it through an origin your application controls. html2canvas provides a proxy configuration option; the project’s getting-started guide describes its use for cross-origin resources.

A proxy is a server-side design decision, not a magic client-side CORS switch. Use an endpoint you control and limit it to resources your application is allowed to fetch. Do not expose an unrestricted endpoint that accepts arbitrary URLs: it can create security and abuse risks. The html2canvas documentation explains the proxy mechanism, but does not provide a secure recipe for an arbitrary-URL proxy. Your application’s server, access controls, and permitted image sources determine the safe implementation.

If you cannot provide a controlled proxy, consider moving the image to storage or a CDN configured for your application’s origin. That can be simpler to operate than proxying every request, but only if you are authorized to host the image and can configure its access policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Debut Screen and Video Recorder Free [PC Download]
  • Screen capture software records all your screens, a desktop, a single program or any selected portion
  • Capture video from a webcam, network IP camera or video input device
  • Use video overlay to record your screen and webcamsimultaneously
  • Intuitive user interface to allow you to get right to video recording
  • Save your recordings to ASF, AVI, and WMV

Separate loading failures from CORS failures

The configuration reference documents a default imageTimeout of 15000 milliseconds, logging enabled by default, and an onError callback for resource failures. Use logging and the callback to identify failed resources, and compare that evidence with the browser’s Network and Console panels. A timeout or failed URL is not the same problem as a CORS denial.

const canvas = await html2canvas(element, {
  useCORS: true,
  imageTimeout: 15000,
  logging: true,
  onError(error) {
    console.error("A resource failed while html2canvas was capturing:", error);
  }
});

The timeout shown is the documented default, not a guaranteed wait for every resource in every environment. Increase it only when the evidence points to a slow but valid image that needs more time. A longer timeout will not fix a blocked request, an incorrect URL, or missing CORS permission.

If your application starts capture before images are ready, wait for them in your own capture flow and inspect failures rather than assuming every load will succeed. For example, for ordinary image elements in the capture target:

async function waitForImages(element) {
  const images = Array.from(element.querySelectorAll("img"));

  await Promise.all(images.map((img) => {
    if (img.complete) {
      return Promise.resolve();
    }

    return new Promise((resolve) => {
      img.addEventListener("load", resolve, { once: true });
      img.addEventListener("error", resolve, { once: true });
    });
  }));
}

const element = document.querySelector("#capture");
if (!element) throw new Error("Capture element was not found");

await waitForImages(element);
const canvas = await html2canvas(element, { useCORS: true });

This wait distinguishes completed image requests from those still loading; it does not make a failed image load, grant cross-origin permission, or guarantee that every non-<img> resource used in the page is ready.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Debut Video Capture Software to Record from a Webcam, Computer Screen or Device [Download]
  • Capture video directly to your hard drive
  • Record video in many video file formats including avi, wmv, flv, mpg, 3gp, mp4, mov and more
  • Capture video from a webcam, network IP camera or a video input device (e.g.: VHS recorder)
  • Screen capture software records the entire screen, a single window or any selected portion
  • Digital zoom with the mouse scroll wheel, and drag to scroll the recording window

When the whole capture is blank or truncated

If many elements disappear together or the output is cut off, do not assume each image has a CORS problem. The html2canvas FAQ points to browser canvas dimension limits and recommends setting windowWidth and windowHeight to match the captured element’s scroll dimensions in relevant cases.

const element = document.querySelector("#capture");
if (!element) throw new Error("Capture element was not found");

const canvas = await html2canvas(element, {
  windowWidth: element.scrollWidth,
  windowHeight: element.scrollHeight
});

Use this as a dimension diagnostic when the problem is a blank or clipped overall result. It is not a substitute for useCORS or a proxy when only restricted cross-origin images are missing. Very large elements may still encounter browser canvas limits.

Choose the fix by image source and symptom

What you find What to try What to verify
Same-origin image, request succeeds Check that capture starts after the image loads; inspect whether its URL redirects. Final URL and response status.
Cross-origin image, host permits CORS Set useCORS: true. The image response includes an appropriate Access-Control-Allow-Origin header.
Cross-origin image, host does not permit CORS Use a controlled proxy or an authorized hosting path configured for your page. The browser receives the image through a permitted origin or CORS response.
Request fails or takes too long Fix the URL or server problem; adjust imageTimeout only for a slow valid resource. Network status, Console output, and html2canvas resource errors.
Entire output is blank or clipped Investigate canvas dimensions and the FAQ’s windowWidth/windowHeight guidance. Whether the issue affects the whole capture rather than particular images.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What a successful fix can—and cannot—promise

html2canvas runs in the browser and reconstructs a representation of a page by traversing the DOM; it does not take a photograph of the browser’s displayed pixels. It supports the CSS properties it understands, and its documentation describes CSS support as necessarily incomplete. A CORS fix can make a permitted image available to the capture, but it cannot make every CSS effect, image format, iframe, or browser rendering detail match the screen exactly. Cross-origin iframes have their own browser security restrictions.

The project’s getting-started material describes use in modern evergreen browsers, including Chrome/Chromium-based browsers, Firefox, and Safari, and says the library is unsuitable for Node.js because it depends on browser APIs. Check your installed package version and target browser when relying on a particular option or behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
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.

Troubleshooting common cases

  • “It shows on the page, but not in the PNG.” That is consistent with a cross-origin image that can display but cannot be read by canvas. Inspect the final response headers, then enable CORS mode if the host permits it, or use an authorized proxy.
  • “I set useCORS and it still disappears.” The option cannot grant server permission. Confirm the final response has the required CORS header and check for redirects, request failures, or capture timing.
  • “The URL is on my domain.” Follow redirects in Network tools. The URL may ultimately resolve to a different origin.
  • “Increasing imageTimeout did nothing.” More time helps only a slow valid resource. It does not repair CORS policy, a failed URL, or a blocked request.
  • “The whole canvas is clipped.” Treat this as a dimension or browser canvas-limit investigation. Check the captured element’s scroll dimensions and the relevant window-size options.
  • “Can I set allowTaint: true?” It is not a way to bypass browser restrictions and export readable pixels. Keep the distinction between permitting a tainted canvas and being able to read or export it.

Or skip the browser setup

If you need a rendered website capture rather than a canvas reconstructed from your application’s DOM, ScreenshotNeo offers a screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. For example, this cURL request captures a page as WebP:

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 the request options. 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, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents, including Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month, with no card required.

Frequently Asked Questions

Can html2canvas run in Node.js?

No. The project describes html2canvas as browser-based and dependent on browser APIs.

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

Does html2canvas produce a pixel-perfect screenshot?

No. It rebuilds a representation from the DOM using CSS properties it understands rather than capturing the browser’s displayed pixels.

Quick Recap

Bestseller No. 2
Screen recorder software for PC – record videos and take screenshots from your computer screen – compatible with Windows 11, 10, 8, 7
Screen recorder software for PC – record videos and take screenshots from your computer screen – compatible with Windows 11, 10, 8, 7
Record videos and take screenshots of your computer screen including sound; Highlight the movement of your mouse
$19.99
Bestseller No. 3
Debut Screen and Video Recorder Free [PC Download]
Debut Screen and Video Recorder Free [PC Download]
Capture video from a webcam, network IP camera or video input device; Use video overlay to record your screen and webcamsimultaneously
Bestseller No. 4
Debut Video Capture Software to Record from a Webcam, Computer Screen or Device [Download]
Debut Video Capture Software to Record from a Webcam, Computer Screen or Device [Download]
Capture video directly to your hard drive; Screen capture software records the entire screen, a single window or any selected portion
$39.99

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.