oksvg is a rasterizer for a partial implementation of the SVG2.0 specification in golang.
Although many SVG elements will not be read by oksvg, it is good enough to faithfully produce thousands, but certainly not all, SVG icons available both for free and commercially. A list of valid and invalid elements is in the doc folder.
oksvg uses the rasterx rasterizer package which implements full SVG2.0 path functions, including the newer 'arc' join-mode.
In addition to 'arc' as a valid join mode value, oksvg also allows 'arc-clip' which is the arc analog of miter-clip and some extra capping and gap values. It can also specify different capping functions for line starts and ends.
Example renderings of unedited open source SVG files by oksvg and rasterx are shown below.
Thanks to Freepik from Flaticon Licensed by Creative Commons 3.0 for the example icons shown below, and also used as test icons in the testdata folder.
oksvg requires the following imports which are not included in the go standard library:
- golang.org/x/net/html/charset
- golang.org/x/image/colornames
- golang.org/x/image/math/fixed
oksvg also requires the rasterx package located here:
- github.com/srwiley/rasterx
After a four year hiatus an updated version of OKSVG has been released on 11/2026. Several bug fixes and enhancements were made (see Monad pull request), as well as limited support for the text tag. This feature is still being developed.




