How the SVG to PNG/ICO Converter works
How it works
The converter reads your SVG markup as plain text and renders it through the same rasterization pipeline a browser uses. The markup is wrapped in a Blob typed as image/svg+xml and turned into an object URL, which is then loaded into an in-memory HTMLImageElement. That step lets the browser parse the SVG and apply its viewBox, gradients, and transforms exactly as it would in an <img> tag. The decoded image is drawn onto a 2D canvas with drawImage, and the canvas is encoded to PNG with toBlob('image/png'). Before rasterizing, the tool forces an explicit width and height on the <svg> root so each export lands at a predictable pixel size.
For ICO output, the same SVG is rasterized at 16, 32, and 48 pixels, and the three PNG frames are packed into a single ICONDIR container. That container is a compact binary format: a 6-byte header (a reserved word, a type field set to 1 for icons, and the frame count), followed by 16-byte directory entries recording each frame's dimensions, 32-bit depth, byte length, and offset, with the raw PNG bytes appended afterward.
The page also scans the markup for inline <script> tags, javascript: URLs, and on* event handlers before export. Preview remains available, but exported files only rasterize static geometry — no script in an SVG ever executes.
Use cases
Developers reach for this tool to generate favicon.ico and PWA manifest icons from a single logo SVG; to turn an inline vector into a raster for documentation, email signatures, or CMS uploads; and to produce crisp multi-resolution icons for desktop applications without installing a graphics suite.
Troubleshooting
A blank or failed preview usually means malformed markup, a missing xmlns attribute, or references to external images, fonts, or stylesheets, which the isolated rasterizer cannot fetch — keep the SVG self-contained. If transparency appears lost, check that no background rectangle is drawn; ICO frames keep a 32-bit alpha channel. Extremely large SVGs with heavy paths can slow encoding or exhaust canvas memory, so reduce the export size or simplify paths. When the script-detection warning appears, exported PNGs and ICOs render only the static portion, so interactive or animated SVGs are flattened.