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.

Use a transparent canvas and export it as PNG: call html2canvas() with backgroundColor: null, then serialize the returned canvas with toDataURL('image/png'). html2canvas applies CSS opacity while it paints pixels, so the downloaded file contains the composited result rather than a reusable CSS opacity rule.

The reliable export pattern

This complete example captures an element, preserves transparent surroundings, and downloads a PNG:

const target = document.querySelector('#capture');

const canvas = await html2canvas(target, {
  backgroundColor: null,
  useCORS: true
});

const link = document.createElement('a');
link.download = 'capture.png';
link.href = canvas.toDataURL('image/png');
link.click();

Run the code after html2canvas has loaded and after the target element and its images are available. The backgroundColor: null setting makes the canvas background transparent. It does not remove opacity from the element; it prevents an otherwise solid canvas color from appearing around it.

What html2canvas does with opacity

html2canvas reconstructs the visible DOM in a Canvas. During rendering, its CanvasRenderer applies an opacity effect by setting the 2D context’s globalAlpha before drawing content. Images are then painted with drawImage. The effective value from CSS opacity is therefore composited into the canvas pixels during capture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Liene M100 4x6'' Photo Printer, Phone Printer 100 Sheets & 3 Cartridges, Full-Color Photo, Portable Instant Photo Printer for iPhone Android, Thermal Dye Sublimation, Wi-Fi Picture Printer 100 Papers
  • User-Friendly Portable Photo Printer for iPhone, Android & PC - Get beautiful and colourful memories with Liene 4x6 photo printer! After opening the entire package, you can find one cartridge + 20 sheets of photo paper (placed inside the machine packaging), as well as an additional box containing 80 sheets of photo paper (which includes two cartridges + 80 sheets of photo paper). Full package includes smartphone photo printer, Liene 4x6 photo printer papers (100 sheets), 3 colour cartridges, and fully sealed cassette to prevent dust. Minimalist and magnetic design for compact storage.
  • Superior Quality 4x6 Photo Printer - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Clean the print head promptly if smudges are observed on printed photos during operation. Get Liene photo printers now for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Wi-Fi Photo Printer for Smartphone - The built-in hotspot of the photo printer makes it easy to print pictures from your phone, avoiding outside interference with a fast and stable connection. No other networks required! Simply connect your device to the independent instant photo printer 4x6 hotspot.
  • Multiple Device Compatibility - Liene phone printer provides instant photo printing for up to 5 simultaneous connections. Share with family and friends or print from your different devices. No additional cables or Bluetooth required when printing photos with this picture printer. Note: Ensure the ink cartridge clicks into place before printing.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Square border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this photo printer for iphone 4x6 prints.

That distinction explains a common misconception: the PNG does not retain a CSS rule such as opacity: .5 that can be edited later. It contains pixels whose alpha and color already reflect the opacity applied during rendering. A transparent PNG source and CSS opacity are also different inputs: the source image may have per-pixel alpha, while CSS opacity affects the rendered image (and, when placed on an ancestor, its descendants). html2canvas combines those effects when painting.

Transparent background versus transparent image pixels

When the image itself has transparency

A PNG with transparent pixels can remain transparent in the export, provided the canvas is not flattened onto a background color and the image can be loaded successfully. Keep backgroundColor: null and use a PNG output.

When the surrounding area must be transparent

Set backgroundColor: null. The option’s documented meaning is a transparent canvas background. Without it, the capture can appear to have lost opacity simply because the transparent regions were filled with a solid color.

When a JPEG is the problem

JPEG has no alpha channel. Exporting with canvas.toDataURL('image/jpeg') necessarily flattens transparent areas and can make a correctly rendered image look opaque. Use image/png whenever alpha matters. WebP can support alpha in some workflows, but PNG is the straightforward, documented html2canvas download path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
KODAK Dock Plus 4x6 Photo Printer, Smartphone Docking, 4PASS, 50 Sheets
  • Dock Photo Printer: The KODAK Dock Plus is a home photo printer that produces high-quality 4x6” prints directly from compatible smartphones. Featuring an integrated docking station, users can place their phone on the printer for better connection while simultaneously charging the device during printing.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Dock Plus is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Home Printing Station: Designed for stable desktop use, this dock photo printer connects to a power outlet for consistent performance and larger 4x6” prints. Ideal for home printing, photo albums, framing, family events, and everyday picture printing.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.

Cross-origin images: the limitation you cannot code around

Set useCORS: true when images are hosted on another origin, but this option only helps if that server returns an appropriate Access-Control-Allow-Origin response header. Browser security rules still apply; html2canvas cannot bypass them.

Symptoms

  • An external image is missing from the capture.
  • Reading the canvas with toDataURL() throws a security error because the canvas is tainted.
  • The live page looks correct, but the downloaded file omits one or more images.

Fixes

  1. Configure the image host to send a CORS response that permits your page’s origin (or the permitted origins required by your deployment).
  2. Serve the asset from the same origin as the page.
  3. Use a server-side or same-origin proxy that fetches the image and serves it with suitable headers.
  4. Verify that the image URL itself is reachable without a login redirect or hotlink block.

Do not assume that adding useCORS alone grants access. It is a request and rendering aid, not a bypass for the same-origin policy.

A production-ready helper

This helper validates the selector, waits for image decoding where possible, and lets you choose a filename:

async function downloadHtml2CanvasPng(selector, filename = 'capture.png') {
  const element = document.querySelector(selector);
  if (!element) {
    throw new Error(`No element matches ${selector}`);
  }

  const images = [...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, {
    backgroundColor: null,
    useCORS: true
  });

  const link = document.createElement('a');
  link.download = filename;
  link.href = canvas.toDataURL('image/png');
  link.click();
}

downloadHtml2CanvasPng('#capture', 'transparent-capture.png');

Waiting for images avoids racing the renderer, but it cannot repair a failed cross-origin request. The helper treats an image error as a completed wait so the capture still finishes; inspect the page and network log if an expected image is absent.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Nelko PP01 Photo Printer, 2x3 Portable Photo Printer, Mini Printer, White
  • 2x3" Portable Photo Printer: The upgraded PP01 photo printer uses advanced inkjet technology. This portable photo printer produces vivid, full-color prints on premium sticky-backed photo paper that is smudge-proof, water-resistant, and tear-resistant. The Nelko mini photo printer is pocket-sized and weighs only 308g, making it ultra-portable for school, travel, and field trips. Each ink cartridge prints up to 80 full-color 2x3 photos on sticky-backed paper
  • Easy Printing via Bluetooth: The PP01 mini photo printer is compatible with iOS and Android phones via Bluetooth. Simply download the Nelko app from Google Play or the App Store. Load the 2x3 photo paper with the smooth side facing down. Install the ink cartridge, connect via Bluetooth, and print directly using the Nelko app. A USB charging cable is included; the adapter is not included
  • High Photo Quality: This mini photo printer uses advanced inkjet technology for clear, vibrant prints. This portable photo printer produces 600 DPI high-resolution images with precise colors, capturing fine details and realistic tones. Each photo comes with adhesive backing, perfect for scrapbooks and preserving your memories. Personalize every photo for holidays, birthdays, or daily events
  • Powerful App: The Nelko 2x3" PP01 photo printer app lets you edit photos and offers a variety of frame designs, making it perfect for personalizing your photos for projects like scrapbooking or journaling. Download the Nelko app to create collages and customize photos with filters, graffiti, borders, stickers, text, AI image editing, and many other features. Edit photos on your phone, then send them to the Nelko app for instant printing in under 90 seconds
  • Versatile Usage Scenarios: This portable photo printer is ideal for travel journals, party favors, and family gatherings. Students use it for planners and photo printing. Crafters use it for DIY projects, custom labels, and scrapbooking. It's a practical tool for bloggers, small businesses, and event photographers to create instant giveaways. Perfect for Mother's Day surprises and heartfelt moments with loved ones using Nelko sticky-backed photo paper.

Keeping the export different from the live page

Use html2canvas’s onclone option to adjust only the cloned document used for rendering. This is useful when a design has an animation, hover state, editor controls, or a temporary background that should not appear in the downloaded image.

const canvas = await html2canvas(document.querySelector('#capture'), {
  backgroundColor: null,
  useCORS: true,
  onclone: clonedDocument => {
    const target = clonedDocument.querySelector('#capture');
    target.classList.add('export-mode');
  }
});

Define .export-mode in your stylesheet for export-only changes. The callback edits the clone, not the visible document, so the user’s live page is unaffected.

Why the browser view and download can differ

Unsupported CSS features

html2canvas supports a defined subset of CSS rather than every feature implemented by a browser. Filters, blend modes, masks, and newer color features can render differently or be omitted. Ordinary opacity is handled during painting, but a visual effect that depends on an unsupported property may not match the browser.

Ancestor opacity and stacking

Inspect opacity on parent elements, not only on the <img>. CSS opacity on an ancestor affects the composited group. Also check overlays, pseudo-elements, blend modes, and positioned backgrounds that may be part of the captured result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Liene Amber M110 Bluetooth Photo Printer 80 Sheets, Portable Photo Printer for iPhone, Thermal Dye Sublimation, Picture Printer 60 Sheets 4x6 Paper & 20 Sheets 3" Square Sticker Paper & 2 Cartridges
  • Dual 4x6" & 3x3" Photo Printer Paper Tray Convenience: Seamlessly print both 6-inch standard photo paper and 3-inch sticky-backed paper with our innovative dual tray design. This compact phone photo printer for smartphone offers easy storage and quick access, making it perfect for diverse printing needs without taking up much space. Enjoy vibrant, high-quality prints every time.
  • Fast Bluetooth Connectivity: Experience lightning-fast printing with our liene photo printer's Bluetooth connection, which pairs in just 13 seconds. Enjoy a seamless and efficient printing experience, perfect for capturing and sharing memories on the go without the hassle of cables or complex setups.
  • Superior Quality Photo Printer 4x6 - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Get Liene photo printers now as amazing gifts for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Multiple Device Compatibility - Liene picture printer for iphone provides instant photo printing for up to mutiple simultaneous connections. Share with family and friends or print from your different devices. No additional cables required when printing photos with this phone printer.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Polaroid border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this iphone photo printer for 4x6 & 3x3 prints.

Scaling and dimensions

The exported bitmap reflects the canvas dimensions and scale used for capture. A very large full-page element can consume substantial memory or exceed browser canvas limits. Capture a smaller region, reduce the scale, or split a long document when a blank or truncated result appears.

Debugging checklist

  1. Confirm the output format. Use toDataURL('image/png'); do not test alpha with JPEG.
  2. Confirm the canvas background. Use backgroundColor: null when the area around the content must stay transparent.
  3. Inspect computed styles. Check the image and every relevant ancestor for opacity, backgrounds, filters, masks, and blend modes.
  4. Check image loading. Wait for images, inspect failed requests, and verify natural dimensions.
  5. Check CORS headers. A successful browser display does not prove that Canvas access is allowed.
  6. Test a minimal case. Capture a plain same-origin image with only opacity: .5. If that works, add other CSS and assets one at a time.
  7. Inspect the actual pixels. Open the PNG over a checkerboard background in an editor; white or black editor backgrounds can make transparency appear lost.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common errors and precise fixes

Symptom Likely cause Fix
Transparent area becomes white or another solid color Canvas background was filled Set backgroundColor: null and export PNG.
Image is missing Cross-origin request failed or image was not ready Wait for loading; configure CORS, use same-origin hosting, or proxy the asset.
toDataURL security exception Canvas is tainted by an image without permitted CORS Fix the response headers or proxy the image; useCORS cannot bypass policy.
Opacity looks right in simple tests but not in the full design Unsupported filter, mask, blend mode, or color feature Simplify the effect, apply it in a supported way, or use a capture method that renders the browser itself.
Capture is blank or cut off Excessive dimensions, timing, or a failed resource Wait for layout, capture a smaller area, reduce scale, and inspect console/network errors.

Choosing the right capture method

html2canvas is appropriate when you need a client-side rendering of a DOM element and can work within its CSS and browser-security limits. Compare any alternative on six points: whether alpha survives, how cross-origin images are handled, CSS feature coverage, browser consistency, output dimensions and scale, and whether it captures a DOM rendering or an original image file. A browser automation screenshot may match modern CSS more closely, while an original asset download preserves the source file rather than the page’s composited appearance.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request returns a 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; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result.

For a direct image response, see the ScreenshotNeo API documentation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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 provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. It supports full-page and element captures, device presets and custom viewports, retina scale, dark mode, custom CSS and JavaScript, clicks, selector waits, network-idle waits, request blocking, cookies, headers, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, TTL caching, signed links, asynchronous jobs, webhooks, bulk capture, usage reporting, and an OpenAPI specification.

Best Value
KODAK Mini 2 Retro 2x3 Portable Photo Printer, 4PASS, 38 Sheets, White
  • Instant Photo Printing: The KODAK Mini 2 Retro is a portable photo printer designed to turn smartphone pictures into high quality prints in seconds. Whether capturing family moments, travel highlights, journaling pages, or creative projects, this mini printer lets you print real photos anytime, anywhere.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Mini 2 Retro is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Print Anytime, Anywhere: Small enough to fit in your hand, bag, or even a pocket, the Mini 2 Retro is built for on-the-go printing. Ideal for parties, trips, school projects, scrapbooks, and spontaneous moments where you want real prints without waiting.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.

The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is on every plan. Sign up free for ScreenshotNeo.

Frequently Asked Questions

Does html2canvas preserve the original CSS opacity value in the PNG?

No. It preserves the visual result by compositing opacity into canvas pixels; the exported PNG does not contain an editable CSS opacity rule.

Can I make only the image transparent while keeping the page background opaque?

Yes. Keep the page or target background opaque in CSS and apply opacity to the image or its intended container. Use backgroundColor: null only when the canvas surroundings themselves must be transparent.

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.

Why does a transparent PNG look opaque in my image viewer?

Some viewers display transparency against white, black, or another default backdrop. Check the file over a checkerboard or contrasting background before concluding that alpha was lost.

The Bottom Line

Set backgroundColor: null, wait for images, resolve CORS issues, and export with toDataURL('image/png'). That preserves the opacity html2canvas actually renders; unsupported CSS and cross-origin restrictions remain separate limitations.

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.