Capture an animated element only after it reaches the visual state you intend to preserve, then call html2canvas() while that state is held. Timing chooses the element’s DOM and CSS state; it does not make html2canvas capture a native browser frame. html2canvas reconstructs an image from DOM and style information, so the result can differ from the pixels displayed on screen.
What html2canvas actually captures
html2canvas is a client-side renderer, not a native screenshot API. It reads the document structure and the CSS information available to it, then builds a canvas representation. The project documentation warns that the result may not be fully accurate to the browser’s real representation because it does not make an actual screenshot.
That distinction matters for animation. Calling the function at a particular instant only helps if the animated element’s DOM and computed styles describe the appearance you want and html2canvas supports the relevant CSS. It does not guarantee that the canvas contains the exact composited pixels from that animation frame.
- Timing: selects the state in which the element is captured.
- Rendering: determines how that state is rebuilt in the canvas.
- Browser policy: can affect fonts, images, iframes, canvases and cross-origin content.
Every CSS property must be implemented individually, and the official FAQ therefore says html2canvas will never have full CSS support. Test the actual animation, browser and styles you plan to use rather than assuming that a visually correct page will produce an identical canvas.
Recommended Free Tools
#1 Best Overall
- 16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting
- Optical Zoom: 4x optical zoom with a 27mm wide angle lens for flexible framing indoors or outdoors
- Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
- Memory Support: Works with Class 10 SD, SDHC, or SDXC cards up to 512GB
- LCD Screen and Battery: 2.7in LCD screen with 2 AA alkaline batteries for convenient on-the-go use
When is the right moment to call html2canvas?
For a single still image
Choose a recognizable state—such as the end of a slide transition, a progress indicator at 50 percent, or a card after its hover effect—and arrange for the element to remain in that state. Then call html2canvas once. A stable state is preferable to hoping that a delay happens to coincide with the desired frame.
This is a practical workflow, not a documented html2canvas frame-lock feature. The reviewed project material does not promise synchronization to a particular animation frame, expose a dedicated freeze API, or define a delay that always selects the same frame.
When the animation is controlled by your code
The most dependable approach is to make the visual state explicit. Replace an animated class with a static class, set an inline style, or pause your own animation, capture, and restore the original state in a finally block. Restore the page even when rendering fails so users do not get a permanently frozen component.
When the animation is not under your control
You can wait for an application-specific signal—such as a class change, a transition-end event, or a component state update—then capture. Do not treat a fixed number of milliseconds, one requestAnimationFrame callback, or a resolved Promise as proof that a particular animation frame has been selected. The official sources do not establish any of those mechanisms as frame-accurate.
A practical still-capture pattern
The following example freezes a CSS animation by applying a developer-defined class. The class and animation name are examples; adapt them to your component.
/* The normal component animation */
.hero {
animation: reveal 900ms ease both;
}
/* A stable state used only during capture */
.hero.capture-state {
animation: none;
opacity: 1;
transform: translateX(0);
}
async function captureHero() {
const element = document.querySelector('.hero');
if (!element) throw new Error('Could not find .hero');
element.classList.add('capture-state');
try {
// Let the browser apply the new styles before html2canvas reads them.
await new Promise(requestAnimationFrame);
const canvas = await html2canvas(element, {
backgroundColor: null,
useCORS: true,
scale: window.devicePixelRatio
});
const link = document.createElement('a');
link.download = 'hero.png';
link.href = canvas.toDataURL('image/png');
link.click();
} finally {
element.classList.remove('capture-state');
}
}
The animation frame in this example is used to allow the style change to be applied; it is not a guarantee about which animation frame html2canvas captures. If your static class changes layout, fonts or image dimensions, wait for those resources and verify the resulting canvas.
Rank #2
- 16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting
- Optical Zoom: 5x optical zoom with a 28mm wide angle lens for flexible framing indoors or outdoors
- Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
- Memory Support: Works with Class 10 SD, SDHC, or SDXC cards up to 512GB
- LCD Screen and Battery: 2.7in LCD screen and a rechargeable lithium-ion battery for on-the-go use
Pausing instead of replacing the animation
For a CSS animation that already has the desired progress, you can temporarily pause it with an inline style. You must know the intended progress value and preserve the element’s existing inline styles.
async function captureAtKnownProgress(element, progress) {
const previous = element.style.cssText;
try {
element.style.animationPlayState = 'paused';
element.style.animationDelay = `-${progress}ms`;
await new Promise(requestAnimationFrame);
return await html2canvas(element);
} finally {
element.style.cssText = previous;
}
}
const canvas = await captureAtKnownProgress(
document.querySelector('.hero'),
450
);
This technique is useful only when your animation’s timing model is understood. Delays, easing functions, iteration counts, fill modes and JavaScript-driven transforms can make the visible state different from a simple elapsed-millisecond calculation. It is your application’s workaround, not an html2canvas guarantee.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Waiting for a component state or transition
If your component emits a reliable event, capture from that event rather than guessing a delay.
function nextTransition(element, propertyName) {
return new Promise(resolve => {
const onEnd = event => {
if (!propertyName || event.propertyName === propertyName) {
element.removeEventListener('transitionend', onEnd);
resolve();
}
};
element.addEventListener('transitionend', onEnd);
});
}
async function captureAfterTransition() {
const card = document.querySelector('.card');
card.classList.add('is-open');
await nextTransition(card, 'transform');
return html2canvas(card);
}
Handle cancellation and reduced-motion preferences in production. A transition may be disabled, interrupted, or never fire when a component is removed. Add a state signal from your own code or a bounded failure path rather than waiting forever.
Options that define the capture, not the animation timing
The project’s configuration and examples document controls for the rendering context. They can improve consistency, but none synchronizes capture to an animation timeline.
- Dimensions and cropping: set the target width, height, and region so the canvas contains the intended element rather than an accidental viewport.
- Scale: choose a scale appropriate for the output resolution. A higher scale creates more pixels and consumes more memory.
- Ignore elements: exclude blinking cursors, controls, timestamps or other nodes that should not appear in the still.
- Background: select a background treatment that matches your design, including transparency where supported by your use case.
Capture after layout and resource loading have settled. A late webfont swap or image decode can change the geometry after you selected the animation state, producing a canvas that is internally consistent but not the state you saw initially.
Rank #3
- Latest Digital Camera Built-in Fill Light : This compact digital camera is paired with a powerful CMOS processor and image stabilization to help you take & record the most exciting moments in 44 MP quality images & FHD 1080P quality videos anywhere, anytime. Plus, there is also a built-in fill light to help you take high quality pictures even in low light&dark settings, making this the perfect camera for all indoors/outdoors situations.
- Long-Lasting Battery Life & 16X Digital Zoom :This point and shoot camera will retain its battery charge even after long use. The controls and functions are easy to operate making this the perfect choice for children, teens and younger. This kids camera supports 16x digital zoom, you can zoom in or out the subject by pressing the W/T button for taking still photos to zoom in or out on distant objects and capture all the details you need.
- Multifunctional & Portable Digital Camera: This cheap digital camera is slim enough to fit in your pocket. You'll easily be able to take it with you on all your indoor/outdoor activities and adventures and ideal for beginners, children and teenagers. This kids digital camera is equipped with 20 filters, anti-shaking, self-timer, continuous shooting, date stamp, time-lapse recording, smile capture, internal MIC and speaker (recording sound videos), great for your daily photography needs.
- WEBCAM & PAUSE FUNCTION : More than just a FHD 1080p digital camera, it also works as a webcam for video calls and vlogging. Connect the camera to the computer, press shutter and power button at the same time and the camera will automatically turn on webcam mode for all your video calling and live streaming needs. The pause function allows you to pause when seeing playback videos.
- A Must Have Photography Device : This digital camera with SD card made from high-quality materials, this retro camera is safe and durable. Perfect for all ages to develop & improve their photographic abilities and observation skills. Our dedicated and experienced 24/7 support team is available for all after purchase troubleshooting, questions and technical help.
Fidelity limits and failure modes
CSS that html2canvas does not reproduce
Transforms, filters, pseudo-elements and other advanced effects may render differently because html2canvas rebuilds them instead of copying the browser’s composited surface. The supported-features reference is the correct place to check a property; do not infer support from how the page looks in your browser.
Cross-origin images and content
Images and other resources must satisfy browser origin rules for use in a canvas. Cross-origin restrictions can leave content missing or make the canvas unreadable. Configure the resource correctly, use appropriate CORS headers, or remove the external content from the capture. An iframe from another origin is not made readable merely because it is visible on the page.
Canvas size and memory
Large full-page captures multiplied by a high scale can exceed browser canvas or memory limits. Start with the smallest region and scale that meets your output requirement, then increase them only after a successful test.
Dynamic content
Clocks, random values, blinking carets and network-fetched data can change between your state check and the renderer’s DOM walk. Hide or freeze those nodes for the capture and restore them afterward.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →When html2canvas is the wrong tool
Exact browser pixels
If you need the pixels the browser actually composited—including effects html2canvas does not implement—use a native browser or automation screenshot facility instead of a DOM reconstruction. This is especially important for visual regression work where small rendering differences matter.
Browser-extension screenshots
The project FAQ directs extension authors toward native tab-capture APIs. That guidance is scoped to extensions: those APIs capture the browser surface and do not share html2canvas’s canvas-size limitations. It is not a claim that one method is best for every ordinary web-page workflow.
Rank #4
- 16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting
- Optical Zoom: 5x optical zoom with a 28mm wide angle lens for flexible framing indoors or outdoors
- Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
- Memory Support: Works with Class 10 SD, SDHC, or SDXC cards up to 512GB
- LCD Screen and Battery: 2.7in LCD screen and a rechargeable lithium-ion battery for on-the-go use
Video or many animation frames
The official materials reviewed here do not establish html2canvas as a dependable video recorder or frame-accurate animation pipeline. For continuous capture, select a tool designed for browser-rendered frames or video, and verify its timing and output requirements directly.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting checklist
| Symptom | Likely cause | Fix |
|---|---|---|
| The image shows the wrong animation state | The element was still changing or the timing guess was unreliable. | Expose a stable application state, pause or replace the animation, wait for your own state signal, then capture. |
| Effects look different from the page | html2canvas reconstructs supported DOM/CSS rather than copying browser pixels. | Check the supported-features reference, simplify the capture styles, or use a native screenshot method. |
| An image or iframe is missing | Cross-origin policy or inaccessible embedded content. | Use resources with appropriate CORS handling, capture same-origin content, or omit the inaccessible node. |
| The browser becomes slow or the canvas fails | The region or scale requires too much memory. | Crop the element, lower scale, and avoid unnecessarily large full-page canvases. |
| The page stays frozen after capture | Temporary styles were not restored after an exception. | Put restoration in finally and test failures as well as successful captures. |
| Nothing happens after waiting for a transition | The transition was canceled, disabled, or the property name did not match. | Listen for the actual property, handle cancellation, and provide a timeout or explicit component-state signal. |
Or skip the browser setup
If you need a clean website screenshot rather than a DOM reconstruction inside your page, ScreenshotNeo provides a GET-based screenshot API. It accepts consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each step can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. This captures a page or configured element as a rendered website image, not a frame sequence from an animation.
Use the API documentation at https://screenshotneo.com/docs/ for authentication and options. A basic call is:
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)
And 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}`);
ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. Its options include full-page lazy-image loading, CSS-selector element capture, device and viewport controls, custom CSS and JavaScript, waits, request blocking, cookies and headers, geolocation, caching, signed links, asynchronous jobs and bulk capture. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
Decision guide
| Requirement | Best starting point |
|---|---|
| One still of a DOM element whose state you control | Freeze or explicitly set the state, then use html2canvas. |
| Exact pixels of a visible browser surface | Use a native browser or automation screenshot facility. |
| Extension tab capture | Follow the native tab-capture guidance in the html2canvas FAQ. |
| Repeated frames or video | Choose a capture workflow designed for animation recording and verify frame behavior. |
| Server-side website screenshots without browser code | Try ScreenshotNeo first for clean shots, non-billed failed loads, and a $5 entry paid plan. |
Frequently Asked Questions
Does html2canvas have a freeze-animation option?
The reviewed official documentation does not describe a dedicated freeze or frame-selection API. Freezing or applying a temporary static style is an application-controlled workaround.
Can one requestAnimationFrame guarantee the captured frame?
No. It can let a style update apply before rendering, but the official material does not promise frame-accurate synchronization.
Is html2canvas suitable for recording an animated div as video?
The reviewed sources do not verify a dependable video or continuous-frame workflow. Use a tool designed for browser frame or video capture instead.
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.

