SVG
Generated by scripts/gen-format-pages.py from docs/data/format-metadata/, FILE_FORMATS.csv and docs/formats-master.csv. Do not edit by hand: change the source, then run the script.
SVG Preview.
At a glance
| Original creator | The World Wide Web Consortium (W3C) |
| Purpose | An XML-based format for two-dimensional vector graphics on the web, combining shapes, images and styled text. |
| Extensions | .svg |
| Poka parser | poka-svg |
| Viewer | poka-svg-viewer |
| Depth tier | Parser with a shared viewer (see Depth tiers) |
| Breadth tier | B2 Broad (see Breadth tiers) |
Preview a sample
These are sample files, not yours. Poka opens a sample in your browser: the file is read and parsed on your device and nothing is uploaded.
How much Poka reads
B2 Broad. The common content of the current and the common older versions is decoded. Some named features or versions are not, and are listed.
Confidence: medium (the reviewer read the code). Basis: Reviewed 2026-10-21 (poka-parsers#452): poka-svg (src/lib.rs: usvg 0.48 parse, resvg render, i_overlay for even-odd fills and clip paths) and poka-svg-viewer, over the corpus (49 .svg; tests/samples.rs). All 49 return all three modes, the UTF-16BE file included; a UTF-8 file's source is the file byte for byte; the image keeps the declared aspect; where the vector mode names no approximation its polygons, drawn plainly, match resvg's pixels in 4 x 4 blocks. The tier is unchanged pending the owner's review: text is not drawn until fonts are bundled, and the hosts still draw .svg themselves until poka-interfaces routes it here. The .svgz variant is a gzip-header card only (B5).
What Poka does not read
- Text is not drawn: no font is bundled in the module yet (the OFL faces of poka-parsers#454 are to be loaded); the output says how many text elements were left out
- Vector mode draws gradients as one flat colour and patterns as grey, and leaves out masks, filters and blend modes; the notes name each, and Image mode draws them all
- Image mode is rendered once at the requested size (max_width x max_height, 1024 by default); zooming does not re-render
- Scripts and event handlers never run; foreignObject is not drawn; images linked to other files or the network are not read
- Files over 12 MiB are refused; encodings other than UTF-8, UTF-16 and ISO-8859-1 are refused by name
- The hosts still draw .svg themselves (desktop arm, showSvgPreview, renderSvg) until poka-interfaces routes it to this module
- svgz: only the gzip header (method, flags, name, comment, timestamp, sizes, CRC-32) is shown; the file is never decompressed or drawn
Background
The Library of Congress lists SVG 1.0 (2001), SVG 1.1 (2003, second edition 2011), SVG Tiny 1.2 (2008) and SVG 2, which was still a draft. .svgz is a gzip-compressed SVG. Poka's poka-svg module parses and draws the file in wasm with usvg and resvg and hands poka-svg-viewer three modes: flattened vector polygons, pixels rendered at the requested size, and the source text. No script runs and nothing outside the file is read, because the renderer has no way to do either.
Derived and related formats
- Compressed SVG (
.svgz): Gzip-compressed SVG per the Library of Congress; Poka's .svgz module shows only the gzip header (method, name, timestamp, sizes and CRC-32) and never decompresses or draws the file.
Libraries
Libraries Poka uses or has assessed for this format, with the status, licence and language the registry records.
- resvg / usvg (candidate; Apache-2.0 OR MIT; Rust; https://github.com/linebender/resvg)
- SVG 2 (W3C) (candidate; public spec; spec; https://www.w3.org/TR/SVG2/)
Sources
- https://loc.gov/preservation/digital/formats/fdd/fdd000515.shtml
- parsers/poka-svg/src/main.rs