[Back to main]

Benchmark Results

Note: The SVG converter isn't perfect and SVG is a horribly complex format. Thus, data might be converted invalidly and rendered wrong. This is a drawback of this benchmark and disturbs the data. A lot of images are still converted correctly and thus the data is still published.

Summarized Results

The benchmark shows that the compression rate from TinyVG compared to SVG lies between 20% and 50% and thus always is a net benefit over SVG.

Dataset File Count Compression Rate (TVG/SVG) Average TVG Size Average SVG Size
Overall 212946,38%3,22410,194
Material Design Icons100051,47%220428
Papirus 100047,20%8411.783
W3C 115 53,18%301567
FreeSVG 5 29,72%12,31541.435
Zig 9 36,15%2.4436.759

You can find the data evaluation here

Process

To create a comparable data set, a script was created which does the following process:

  1. Optimize the input SVG with SVGO to have comparably small files
  2. Convert SVG to TinyVG text
  3. Convert TinyVG text to TinyVG binary
  4. Render TinyVG binary to PNG file
  5. Render TinyVG binary to SVG file
  6. Optimize the output SVG with to have comparably small files

If step 2 fails, we will skip the file as we cannot perfom comparison.

The outputs of step 1, 4 and 6 are displayed in the comparison rendering, the outputs of step 1 and 3 are compared in the benchmark.

Datasets

Each dataset has a CSV list with Filename, SVG and TVG Size as well as a comparison rendering which contains the file name, the original SVG rendered by chrome, a PNG rendered from the generated TVG file, and a SVG generated from the TVG file.

Material Design Icons

This dataset mostly contains single-path icons with otherwise identical files. The result here documents the raw path compression.

For the benchmark, the first 1000 successfully converted icons are compared, while 437 icons were skipped in the process. This means that we have roughly 70% conversion success rate.

Papirus

This icon theme was chosen as a colorful alternative to the Material Design Icons and proved itself as a wild hodgepodge of very different SVG files.

For the benchmark, the first 1000 successfully converted icons are compared, while 250 icons were skipped in the process. This means that we have roughly 80% conversion success rate.

W3C

This dataset is provided by the W3C and contains a lot of files that exercise what a SVG renderer can do. A lot of these files isn't even rendered correctly by modern day browsers.

freesvg.org

This dataset contains some random images from freesvg.org. They were chosen by xq, the initiator of this project at his liking.

Zig

This dataset is chosen as Zig is the primary programming language TinyVG was implemented with. It contains some logos and two drawings that exercise both layering and path complexity.