An alternative binary encoded vector graphics format.
Why another format?
SVG is a horribly complex format and an overkill for most projects. The specification includes way too many edge cases so implementing a new SVG renderer will always have drawbacks or missing pieces.
TinyVG tries to be simpler. Fewer features, but powerful enough to cover 90% of use cases.
- Compact binary encoding (39% size of a comparable SVG file on average)
- Cover 90% of typically used SVG features files while only having a tiny fraction of complexity
- Common 2D primitives are supported (paths, lines, rectangles, polygons)
- Linear and radial two-point gradient support.
- Configurable precision for smaller files.
- Comprehensible specification
The tiger is rendered with the current implementation of the TinyVG renderer:
The original SVG is 96,719 bytes large, while the optimized one is 85,806 bytes large. When converted to TinyVG, the file shrinks to 27,522 bytes. This means we only have 32% size of the optimized source data.
Real World Data
A short summary is that TVG is typically between 20% and 50% of the equivalent SVG file in size and way easier to parse or render.
The specification is a human-readable, informal description of the format. It should enable programmers to create new TinyVG implementations.
There is also a textual representation that is described roughly in this document:
Here you can download some TinyVG files to inspect or toy around with:
- Tiger (TVG, TVGT, SVG, PNG, Source)
- Shield Icon (TVG, TVGT, PNG, Source)
- Flowchart (TVG, TVGT, DOT, PNG)
- Folder Icon (TVG, TVGT, SVG, PNG, Source)
- Comic (TVG, TVGT, SVG, PNG, Source)
- Chart (TVG, TVGT, SVG, PNG)
The tools provide a TinyVG renderer as well as a text format converter for TinyVG text and SVG.
The native library is suitable for integrating TinyVG into native projects. Be it Zig, Rust, C or C++, you can use this library with any language that supports the C ABI. This also includes dotnet via P/Invoke and Java via JNI. Right now, only a C API is provided, wrapping to other languages must be done manually at this time.
The library provides means to render TinyVG to bitmaps and SVG (text).
There’s also a polyfill available that allows you to use TinyVG in the browser:
There also is a Discord Community for a more casual and quick interaction, you can also get help there!