Compare / open-source library
screen2api vs html-to-image
The actively maintained successor to dom-to-image: it serializes the node into an SVG foreignObject and rasterizes that, letting the browser do the layout.
Where html-to-image is the better choice
Genuinely — if any of these is your requirement, use them.
- Free, MIT-licensed, and actively maintained — a real advantage over html2canvas.
- Because the browser lays out the serialized copy, fidelity is often better than re-rendering approaches.
- Small, focused API that composes into whatever pipeline you are building.
- You want open-source capture inside a pipeline you are building yourself anyway.
- Your pages avoid the serialization path's known rough edges, or you are willing to work around them.
Where screen2api differs
Serialization has its own edge cases
The foreignObject route requires every external resource — images, fonts, stylesheets — to be fetched and inlined into the SVG copy, so cross-origin assets, canvas content and font loading each carry their own class of quirks, with browser-specific behaviour on top. Reading computed styles from the live DOM skips the copy step entirely: the capture is taken from the page that is already rendered.
The pipeline is the product
Like any capture library, html-to-image ends at pixels in memory. Signed uploads, webhook delivery with your own params attached, the annotation editor, pixel-destroying redaction, table-to-CSV — the parts your users see and your backend consumes — are the product here, not an exercise left to you.
Try the capture on your own page
The playground runs the real SDK on a real page — no account, and the free tier is 500 captures a month when you're ready.