Screenshotting 100 SVGs to PNGs with headless Chrome on Windows
We had 100 SVG artworks generated by quantum computers, and we needed PNGs to put on IPFS. SVG support across NFT platforms and wallets is inconsistent enough that we didn't want to rely on it, so the vector files had to become raster files. On Linux or macOS you'd type cairosvg.svg2png(...) and be done in five minutes. We were on Windows. It took considerably longer than that, and most of the "obvious" solutions quietly destroyed our art before I found one that worked: pointing headless Chrome at each SVG and taking a screenshot. The core problem SVG is XML, and converting it to PNG requires a real SVG rendering engine — something that parses the markup, executes gradient definitions, applies filters, composites layers, and only then emits pixels. That's the whole job, and the Python ecosystem's default tool for it is cairosvg , which wraps the Cairo 2D library: # This works beautifully on Linux and macOS import cairosvg cairosvg.svg2png(url="input...