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

To render images with html2canvas, make sure they have loaded before capture and that any image hosted on another origin permits browser CORS access. Set useCORS: true when the image server sends an appropriate Access-Control-Allow-Origin header. If it cannot, use a same-origin proxy. Then export the returned canvas with toBlob() or toDataURL().

Do not use allowTaint: true as an export fix: it may allow a foreign image to be painted, but the browser can still block reading the canvas. And remember that html2canvas reconstructs an image from DOM properties it understands; it is not a pixel-perfect screenshot of the browser.

What html2canvas does—and why images can be missing

html2canvas walks the DOM, reads supported properties, and draws a canvas representation. It does not capture the browser’s final composited pixels. The project documentation describes the result as based on the DOM and cautions that it may not exactly match the page as rendered in the browser.

That distinction matters for images. A browser may display an image normally while preventing JavaScript from reading its pixels. When html2canvas cannot load an image in a way that permits drawing, or skips it to protect the canvas, the exported result can be missing that image. Other causes include an image that has not loaded yet, an inaccessible cross-origin URL, or a layout whose dimensions do not include the full content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Wacom Intuos Small, Wired Graphic Drawing Tablet with Pen + Software
  • Wacom Intuos Small Graphics Drawing Tablet: Enjoy industry leading tablet performance in superior control and precision with Wacom's EMR, battery free technology that feels like pen on paper
  • Works With All Software: Wacom Intuos tablet can be used in any software program to explore new facets of digital creativity; draw, paint, edit photos/videos, create designs, and mark up documents
  • What the Professionals Use: Wacom's industry leading pen technology and pen to paper feeling makes it the preferred drawing tablet of professional graphic designers
  • Software and Training Included: Only Wacom gives you software with every purchase. Register your Intuos tablet and gain access to some of the best creative software and Wacom's online training
  • Wacom is the Global Leader in Drawing Tablet and Displays: For over 40 years in pen display and tablet market, you can trust that Wacom to help you bring your vision, ideas and creativity to life

Start by separating two questions: can the browser display the image, and can script safely read pixels from it? Display alone does not establish permission for canvas export.

Fix cross-origin images with CORS or a proxy

Use CORS when the image host permits it

Images from the same origin as the page can be read by canvas. A cross-origin image requires permission from its server. If that server returns an appropriate Access-Control-Allow-Origin response header, set useCORS: true in the html2canvas options. For an image element that you manage directly, the browser’s CORS image-request pattern also uses a crossorigin attribute.

<img crossorigin="anonymous" src="https://images.example.com/photo.jpg" alt="Example">

The image server’s response policy is decisive: adding the attribute or enabling useCORS does not grant permission by itself. If the server does not allow the page’s origin, the browser will not make the image readable to canvas.

Use a same-origin proxy when the image host cannot allow CORS

When you cannot change the image server’s headers, route the image through a proxy on your own origin. The proxy fetches the remote resource and returns it in a browser-loadable form, such as a base64 data URI. Pass the proxy URL using html2canvas’s proxy option. Build the proxy so it validates destinations and restricts what callers can fetch; an unrestricted proxy can be abused to request internal or unintended resources.

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.
Rank #2
Sale
XPPen Deco 01 V3 10x6 Drawing Tablet, 16K Battery-Free Stylus, 8 Keys
  • Word-first 16K Pressure Levels: The upgraded stylus features 16,384 levels of pressure sensitivity and supports up to 60 degrees of tilt, delivering smoother lines and shading for a natural drawing experience. With no battery or charging needed, it operates like a real pen, making it easy for beginners to create effortlessly. This functionality helps novice artists develop their skills and explore their creativity without the intimidation of complex tools
  • Designed for Beginners: This drawing pad desinged with 8 customizable shortcuts for both right and left-hand users, express keys create a highly ergonomic and convenient work platform
  • Perfectly Adapted for Android: The XPPen Deco 01 V3 art tablet supports connections with Android devices running version 10.0 and above. It is recommended to download the XPPen Tools Android application, which adapts to your smartphone's screen aspect ratio, ensuring accurate mapping. It also supports mapping on Android screens with different aspect ratios in portrait mode
  • Large Drawing Space, Bigger Bold Inspiration: This expansive drawing pad has10 x 6.25-inch helps you break through the limit between shortcut keys and drawing area
  • Easy Connectivity for Beginners: The Deco 01 V3 offers USB-C to USB-C connectivity, plus adapters for USB C. This ensures easy connection to various devices, allowing beginner artists to set up quickly and focus on their creativity without compatibility concerns. Whether using a laptop, tablet, or desktop, the Deco 01 V3 provides a seamless experience, making it an ideal choice for those just starting their digital art journey

A proxy adds a network hop and another component that can fail. Check that it returns the expected image content, handles errors and timeouts, and is reachable from the browser. Prefer server-side CORS configuration when you control the image host.

Why allowTaint is not an export workaround

allowTaint: true changes whether a tainted image may be drawn; it does not make the canvas readable afterward. Protected operations such as toDataURL(), toBlob(), and pixel reads can still fail on a tainted canvas. If the result must be exported or inspected, solve the origin restriction with CORS or a proxy instead.

Capture an element and export it as a PNG

Load html2canvas in your browser application before running this code, and replace #capture with the selector for the content to render. The element should be in the document and its images should be loaded before capture. The function returns a PNG Blob, which you can upload or download.

async function renderElementAsPng() {
  const element = document.querySelector('#capture');
  if (!element) {
    throw new Error('Could not find #capture');
  }

  const images = Array.from(element.querySelectorAll('img'));
  await Promise.all(images.map(image => {
    if (image.complete) return Promise.resolve();
    return new Promise(resolve => {
      image.addEventListener('load', resolve, { once: true });
      image.addEventListener('error', resolve, { once: true });
    });
  }));

  const canvas = await html2canvas(element, {
    useCORS: true,
    scale: window.devicePixelRatio,
    windowWidth: element.scrollWidth,
    windowHeight: element.scrollHeight
  });

  return new Promise((resolve, reject) => {
    canvas.toBlob(blob => {
      if (blob) resolve(blob);
      else reject(new Error('PNG export returned no blob'));
    }, 'image/png');
  });
}

renderElementAsPng()
  .then(blob => {
    const link = document.createElement('a');
    link.href = URL.createObjectURL(blob);
    link.download = 'capture.png';
    link.click();
    URL.revokeObjectURL(link.href);
  })
  .catch(error => console.error('Could not render the capture:', error));

The image wait prevents the capture from starting while ordinary img elements are still loading. It does not fix a failed request or bypass CORS; inspect the browser’s Network and Console panels if an image is still absent. Applications that change image sources during rendering should wait for the final source, not merely for the original element to complete.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
HUION Inspiroy H640P 6x4 inch Drawing Tablet 8192 Pen Pressure
  • Customize Your Workflow: The 6 customizable press keys on Huion H640P drawing tablet for pc let you assign your most-used commands—like undo, zoom, brush switch, or save—so you can keep your hands on the tablet and your mind on the art. Whether you're a digital painter switching brushes, or a comic artist zooming in and out, these keys keep your workflow smooth and uninterrupted. Plus, the Huion driver lets you save different shortcut profiles for different apps, so you never have to reconfigure when switching software.
  • Professional Pen Performance: Huion H640P drawing pad for computer comes with the battery-free PW100 stylus that's always ready when inspiration strikes. With 8192 levels of pressure sensitivity, every light sketch, or bold stroke responds naturally to your hand—just like a real pen. The 5080 LPI resolution and 233 PPS report rate deliver lag-free, precise strokes, so you can draw confidently without second-guessing your cursor. The pen side buttons help you switch between pen and eraser instantly.
  • Compact and Portable: Huion H640P computer graphics tablet features a compact, ultra-portable design at just 0.3 inches thin and 0.61 lbs light, so it slides easily into your backpack—perfect for sketching in coffee shops, taking notes in class, or editing on the go between home and studio. The 6x4 inch active area offers enough room for natural pen movements while fitting comfortably on crowded desks, or lecture hall seats.
  • Stable Compatibility: Huion H640P graphic drawing tablet works seamlessly with Mac, Windows, Linux PCs, and Android smartphones/tablets (OS version 6.0 or later). Left-handed friendly, and you just need to flip the tablet and adjust the settings in the driver. Please note: H640P does NOT support iPhone/iPad.
  • Move Beyond the Mouse: Huion Inspiroy H640P is a pen tablet that replaces your mouse for more natural, precise control. Freehand draw, take notes, or even play OSU—everything you do with a mouse, you can do better with a pen. The precise tip makes it ideal for detailed photo editing, graphic design, or signing PDF. Meanwhile, the ergonomic pen grip helps you avoid the strain that comes from hours of using a mouse.

Choose the dimensions deliberately

scale controls the output pixel density and defaults to window.devicePixelRatio. A larger scale can make text and images sharper, but it also increases canvas dimensions and memory use. width and height set output dimensions; windowWidth and windowHeight define the viewport used to evaluate styles and media queries. For a long element, matching the window dimensions to its scrollWidth and scrollHeight helps avoid rendering only the visible area.

These settings are not interchangeable. Changing the viewport can change responsive layout, while changing output width or height changes the canvas size. If a result is clipped, compare the element’s scroll dimensions, the chosen window dimensions, and the actual canvas dimensions before increasing scale.

Exclude controls and other unwanted nodes

For nodes you do not want included, add data-html2canvas-ignore to the element or use the ignoreElements option. This is useful for buttons, editing handles, or transient UI that should not appear in the output. Excluding an element does not make unsupported CSS or inaccessible image content render correctly.

Choose an export format and handle the result

After the html2canvas promise resolves, the returned value is a canvas. Use toBlob() when you need a binary file for upload or download. Use toDataURL('image/png') when a data URL is useful, such as for a small inline image. Data URLs encode the image into a string and can consume more memory than a Blob for larger captures. Either readback method can fail if the canvas is tainted, so resolve image-origin access before export.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
XPPen Artist 13.3 Pro V2 Drawing Tablet with Screen, 16K, Full-Laminated
  • PLEASE NOTE:XPPen Artist13.3 Pro drawing tablet Need to connect with computer,you need to use it with your computer or laptop, the 3 in 1 cable is included
  • Drawing Tablet with Screen: Tilt Function- XPPen Artist 13.3 Pro supports up to 60 degrees of tilt function, so now you don't need to adjust the brush direction in the software again and again. Simply tilt to add shading to your creation and enjoy smoother and more natural transitions between lines and strokes
  • Graphics Tablets: High Color Gamut- The 13.3 inch fully-laminated FHD Display pairs a superb color accuracy of 88% NTSC (Adobe RGB≧91%,sRGB≧123%) with a 178-degree viewing angle and delivers rich colors, vivid images, and dazzling details in a wider view. Your creative world is now as powerful as it is colorful
  • Drawing Pad: One is enough- The sleek Red Dial on the display is expertly designed with creators in mind, its strategic placement allows for natural drawing postures. With just one wheel, you can effortlessly zoom in and out, adjust brush sizes, and flip the canvas—all tailored to suit the habits of everyday artists. The 8 customizable shortcut keys allow you to personalize your setup, streamlining your workflow and enhancing creative efficiency
  • Universal Compatibility & Software Support:supports Windows 7 (or later), Mac OS X 10.10 (or later), Chrome OS 88 (or later), and Linux systems. Fully compatible with major creative software including Photoshop, Illustrator, SAI, and Blender 3D. Register your device to access additional programs like ArtRage 5 and openCanvas for expanded creative possibilities.

For a JPEG, request image/jpeg and supply a quality value supported by the browser; unlike PNG, JPEG does not preserve transparency. PNG is the straightforward choice for a lossless image with transparency. The browser’s canvas APIs determine the actual encoding behavior.

Diagnose blank, clipped, or inaccurate results

Blank output

  • Confirm the selector matched a real element and that it has nonzero dimensions when capture begins.
  • Wait for the application to finish rendering and for images to load. A completed page navigation does not necessarily mean later application content is ready.
  • Check browser developer tools for blocked image requests, failed proxy responses, and JavaScript errors.
  • Try a small same-origin image as a control. If it appears but a remote image does not, investigate the remote server’s CORS response.

Missing images or a tainted canvas

  • For a foreign-origin image, confirm the image server allows the page’s origin with an appropriate CORS response header.
  • Use useCORS: true for permitted remote images, or route images through a controlled same-origin proxy if the host cannot grant access.
  • Do not rely on allowTaint: true when you need to export, upload, or read pixels from the canvas.
  • Check that redirects do not send the browser to a different host with different CORS behavior.

Clipped sections or unexpectedly small output

  • Compare the element’s scrollWidth and scrollHeight with the configured window dimensions.
  • Check whether responsive styles or media queries change at the selected windowWidth and windowHeight.
  • Reduce scale if the capture is very large. Browser canvas size limits can cause blank or incomplete output, and the permitted maximum varies by browser and device.

Differences from the visible page

html2canvas only implements selected CSS properties, so its output can differ from the browser’s final rendering. Same-origin iframe content is supported recursively, but cross-origin iframe documents cannot be read through contentDocument and therefore cannot be rendered this way. Plugin content such as Flash or Java applets is not rendered. For content whose fidelity depends on browser-composited pixels or cross-origin frames, use a browser screenshot approach rather than expecting DOM reconstruction to reproduce it exactly.

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

Performance and reliability considerations

Captures run in the browser and depend on browser APIs including window and document; html2canvas is not a server-side renderer. Large pages and high pixel scales require more memory and time than small elements. Capture only the needed region, avoid needlessly high scale, and exclude UI that adds no value. If the page has asynchronous content, wait for a meaningful ready condition—such as the target element being present and its images finishing—rather than an arbitrary delay alone.

For repeatable output, keep viewport dimensions, device scale, and page state consistent. Treat third-party images as external dependencies: they can change, fail, redirect, or apply different access headers. A successful canvas render is not proof that every browser will produce identical pixels.

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.
Best Value
Sale
Drawing Tablet XPPen StarG640 Digital Graphic Tablet 6x4 Inch Art Tablet with Battery-Free Stylus Pen Tablet for Mac, Windows and Chromebook (Drawing/E-Learning/Remote-Working)
  • Battery-Free Pen: StarG640 drawing tablet is the perfect replacement for a traditional mouse! The XPPen advanced Battery-free PN01 stylus does not require charging, allowing for constant uninterrupted Draw and Play, making lines flow quicker and smoother, enhancing overall performance
  • Ideal for Online Education: XPPen G640 graphics tablet is designed for digital drawing, painting, sketching, E-signatures, online teaching, remote work, photo editing, it's compatible with Microsoft Office apps like Word, PowerPoint, OneNote, Zoom, Xsplit etc. Works perfect than a mouse, visually present your handwritten notes, signatures precisely
  • Compact and Portable: The G640 art tablet is only 2 mm thick, it's as slim as all primary level graphic tablets, allowing you to carry it with you on the go
  • Chromebook Supported: XPPen G640 digital drawing tablet is ready to work seamlessly with Chromebook devices now, so you can create information-rich content and collaborate with teachers and classmates on Google Jamboard’s whiteboard; Take notes quickly and conveniently with Google Keep, and effortlessly sketch diagrams with the Google Canvas
  • Multipurpose Use: Designed for playing OSU! Game, digital drawing, painting, sketch, sign documents digitally, this writing tablet also compatible with Microsoft Office programs like Word, PowerPoint, OneNote and more. Create mind-maps, draw diagrams or take notes as replacement for mouse

Or skip the browser setup

If you need a screenshot of a public page rather than a canvas made from arbitrary in-memory DOM state, ScreenshotNeo can capture the page with one API request. It is a website screenshot API and MCP server; its browser capture is an alternative to setting up html2canvas, not a way to export an unsaved DOM state from your app. The API and its options are documented at ScreenshotNeo’s API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The same request in 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)

Or 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 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 are not billed, and response headers report the page verdict and billing status. Its MCP server gives AI agents tools for screenshots, page information, and PDF capture. The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Every feature is available on every plan.

Create a free ScreenshotNeo account for 1,000 screenshots a month with no card.

Frequently Asked Questions

Can html2canvas capture a page on the server?

No. html2canvas runs in a browser context and depends on browser APIs such as window and document. Use a browser-based capture service or another server-side renderer when the capture must run without a user’s browser.

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

Will html2canvas reproduce every CSS effect exactly?

No. It reconstructs the DOM using the CSS properties it implements, so the canvas may differ from the browser’s final composited page.

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.