User:JoKalliauer/SVG test suites
SVG test suites
editSummary
editlibrsvg 2.50 | resvg 0.14.0 | Inkscape 1.0 | Batik 1.13; 1.14[clarification needed] | |
---|---|---|---|---|
Correctness according to the W3C test suite | 0,662 | 0,831 | 0,745 | 0,801 |
cpu-time taken in the W3C test suite (512 px) | 1m 46,776s | 1m 04,490s | 7m 57,465s | 6m 51,560s |
Correctness according to resvg test suite | 0.754 | 0.956 | 0.729 | 0.703 |
Time measured by resvg test suite | 4min 05sek | 2min 30sek | 46min 22sek | 61min 29sek |
Correctness with Wikimedia featured pictures | 0.92 | 1.00 | ||
Time with Wikimedia featured pictures | 5m 17,701s | 4m 46,639s | 15m 28,202s | 11m 30,768s |
time 2006-MediaWiki-collection (512px) | 23.129s | 9.551s | 186.809s | 87.313s |
solved phab:-tasks relative to all tasks[1][clarification needed] | 0.55[2] | 0.88 | 0.78 |
commands
editcommand | librsvg | resvg | Inkscape | Batik |
---|---|---|---|---|
width 512px | -w 512 [3]
|
-w 512 [4]
|
-w 512 [5]
|
-w 512 [6]
|
dpi 96 | -a -d 96dpi -p 96dpi [7]
|
--dpi 96 [8]
|
-d 96 [9]
|
-dpi 96 [10]
|
lang=de-AT, de, en | Unix $LANG environment[11] | --languages 'de-AT, de, en' [12]
|
Unix $LANG environment[11] | -lang [11] (not working)
|
which commands are used |
#librsvg&inkscape&prerequieries
sudo dnf --refresh upgrade
if [ -f "/etc/debian_version" ]; then
sudo apt install python3-pip cargo npm inkscape optipng scour librsvg2-bin
fi
if [ "$(grep -Ei 'fedora|redhat' /etc/*release)" ]; then
sudo dnf install inkscape #inkscape
sudo dnf install librsvg2 #librsvg
sudo dnf install cargo #resvg
sudo dnf install cabextract #for unpacking windows fonts
sudo dnf install google-noto-\* #for google-noto-fonts (>1GB!)
sudo dnf install python3-pip npm optipng python3-scour batik batik-rasterizer ImageMagick qt5-qtbase-devel harfbuzz-devel qt5-qtbase qt5-qtbase-devel qt5-qtsvg qt5-qtsvg-devel librsvg2-tools wxsvg wxsvg-devel #not shure if needed
fi
#batik
mkdir -p ~/prgm
cd ~/prgm
wget https://mirror.klaus-uwe.me/apache//xmlgraphics/batik/binaries/batik-bin-1.14.zip
unzip batik-bin-1.14.zip
#resvg
mkdir -p ~/Documents/GitDesktop/
cd ~/Documents/GitDesktop/
git clone https://github.com/RazrFalcon/resvg.git
cd resvg/
git config pull.rebase false #optional
git pull #optional
cargo build --release
./make-vendored.sh
#!/bin/bash export WIDTH=512 mkdir -p 4Batik${WIDTH} 3Ink${WIDTH} 2lib${WIDTH} 1Resvg${WIDTH} 3InkShell${WIDTH} cp aa_resvg.sh 1Resvg${WIDTH}/aa_resvg.sh cp aa_librsvg.sh 2lib${WIDTH}/aa_librsvg.sh cp aa_Inkscape.sh 3Ink${WIDTH}/aa_Inkscape.sh cp aa_batik.sh 4Batik${WIDTH}/aa_batik.sh cp aa_InkShell.sh 3InkShell${WIDTH}/aa_InkShell.sh cd SVG #for file in *.svg # do # mv -- "$file" "${file// /_}" #done for file in *.svg do cp "$file" ../4Batik${WIDTH}/"$file" cp "$file" ../3Ink${WIDTH}/"$file" cp "$file" ../2lib${WIDTH}/"$file" cp "$file" ../1Resvg${WIDTH}/"$file" done cd .. date cd 1Resvg${WIDTH} echo $(pwd) time taskset -c 0 ./aa_render.sh &> aa_re.txt cd .. date cd 2lib${WIDTH} echo $(pwd) time taskset -c 0 ./aa_render.sh &> aa_lib.txt cd .. date cd 3Ink${WIDTH} echo $(pwd) time taskset -c 0 ./aa_render.sh &> aa_Ink.txt cd .. date cd 4Batik${WIDTH} echo $(pwd) time taskset -c 0 ./aa_render.sh &>aa_batxt cd .. date cd 3InkShell${WIDTH} echo $(pwd) ./aa_render.sh &> aa_Ink.txt cd .. date
#!/bin/bash date for file in *.svg do echo & #Add a empty line to split the output echo $file & rsvg-convert "$file" -w ${WIDTH} -a -d 96 -p 96 >"${file%.svg}_librsvg.png" done date
#!/bin/bash date for file in *.svg do echo & #Add a empty line to split the output echo $file & ~/Dokumente/GitDesktop/resvg/target/release/resvg "$file" -w ${WIDTH} "${file%.svg}_rendersvg.png" done date
#!/bin/bash date for file in *.svg do echo & #Add a empty line to split the output echo $file & inkscape "$file" -w ${WIDTH} --export-type="png" mv "${file%.svg}.png" "${file%.svg}_Inkscape.png" & done date
#!/bin/bash date for file in *.svg do echo "file-open:${file}; export-type:png; export-width:${WIDTH}px; export-do;" >> aa_toInkscape.txt done echo quit >> aa_toInkscape.txt date time taskset -c 0 inkscape --shell --actions="$(cat aa_toInkscape.txt)" date
#!/bin/bash date for file in *.svg do echo & #Add a empty line to split the output echo $file & java -Djava.awt.headless=true -jar ~/prgm/batik-1.14/batik-rasterizer-1.14.jar -w ${WIDTH} "$file" -d "${file%.svg}_batik.png" done date |
Differences that are no mistake
edit- Different Antialising
- Different font-fallback
- 90dpi or 96dpi, see User:JoKalliauer/SVG_units, this can be fixed for some render e.g. resvg; librsvg 2.52 librsv2.52 will change from 90dpi to 96dpi
W3C SVG 1.1 test suite
edithttps://www.w3.org/Graphics/SVG/Test/20110816/
SVG | librsvg | resvg | Inkscape | batik | chrome | firefox | svgnet | wxsvg | qtsvg |
---|---|---|---|---|---|---|---|---|---|
correctness 2 | 0,662 | 0,831 | 0,745 | 0,801 | 0,866 | 0,855 | 0,614 | 0,193 | 0,418 |
user sys time (natural resolution) | 13m 23.399s | 0m 42.104s | 22m 55.256s | 70m 16.007s | |||||
time (300px) | 13m 12,446s | 1m 7,044s | |||||||
time (512px) | 14m 43,146s | 1m 12,591s | 21m 14,825s (4m 13.46s[13]) | 29m 46,446s | |||||
time (512px) | 1m52,417s |
Where resvg is superior to librsvg | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Where librsvg is superior to resvg | |||||||||||||||||||||||
|
Where both fail | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
resvg test suite
edit1338 files from https://github.com/RazrFalcon/resvg-test-suite/tree/master/tests, uploaded in Category:Rendersvg_test_suite.
SVG | librsvg 2.50 | resvg 0.14.0 | Inkscape 1.0 | Batik 1.13; 1.14 | Chromium r818858 | Firefox 83 | SVG.NET 3.0.102 | wxSVG 1.5.11 |
---|---|---|---|---|---|---|---|---|
correctness[14] | 0.754 | 0.956 | 0.729 | 0.703 | 0.886 | 0.872 | 0.450 | 0.254 |
time | 4min 05sek | 2min 30sek | 46min 22sek | 61min 29sek | ||||
time (300px) | 4m 26,674s | 2m 14,276s | 27m 17,977s | 45m 1,809s | ||||
time (512px) | 6m 13,054s | 2m 35,135s | 38m 5,628s (17m 8.889s[13]/ 2m 22.970s[15]) | 63m 36,648s |
all Images |
User:JoKalliauer/SVG test suites/all Images |
141 files in https://commons.wikimedia.org/wiki/Category:Featured_pictures_on_Wikimedia_Commons_-_vector
This category represents the most qualitative SVG-files on Commons. Different font-fallbacks are not considered as mistake.
SVG | librsvg 2.50 | resvg 0.14.0 | Inkscape 1.0 | batik 1.14 |
---|---|---|---|---|
correctness | 0.92 | 1.00 | ||
real time (limited to 1CPU) | 5m 17,701s | 4m 46,639s | 15m 28,202s | 11m 30,768s |
real time (300px) | 3m 44,533s | 0m 50,908s | 3m 37,714s | 8m 29,825s |
time (512px) | 4m 28,886s | 1m 15,307s | 5m 9,164s (2m 27,598s[13]) | 10m 8,168s |
User:JoKalliauer/SVG test suites/Featured details
User:Glrx might be one of the experts about special SVG-features and details about SVG-standard, they are known for contributing useful test files.
Supporting SVG 2.0 features is not considered as a mistake, even if rendered as SVG 1.1 would be different. Since SVG 2.0 is not released, so such features do not count as mistakes, even if implemented wrong.
SVG | librsvg 2.50.3 - 2.54.3 | resvg 0.14.0 - 0.22.0 | Inkscape 1.0.2 - 1.2 | Batik 1.14 |
---|---|---|---|---|
1 alignment-baseline |
1 alignment-baseline |
|||
|
|
| ||
undefined behavior for SVG1.1 |
||||
selected files from Category:Pictures showing a librsvg bug
editThis files are known to be difficult to render and are relevant features on commons. However here a comparison about correctness might be missleading.
see Librsvg_bugs for most important ones
see Template:C for simple minimal working examples
textPath
editThere exist no renderer and no browser (at least neither Chrome nor Firefox) that fully suppport textPath
: e.g:
- librsvg does not support it at all(!)
- resvg not in combination with
textLength
- Inkscape supports negative offsets wrong
- batik chrashes sometimes, here it is difficult to find out what's wrong
User:JoKalliauer/SVG_test_suites/textPath |
User:JoKalliauer/SVG test suites/textPath |
files showing a resvg-bug
editThis files are known to be difficult to render and are relevant features on commons. However here a comparison about correctness might be missleading, since they are taken from resvg Bugreports .
Known resvg-issues and workarounds |
User:JoKalliauer/SVG test suites/resvg Issues details |
requested files by others
editSVG | resvg | librsvg | Ink | batik | |
---|---|---|---|---|---|
Template:Vertical header | |||||
Template:Vertical header | |||||
Template:Vertical header |
Renderers
editTested:
- w:librsvg, a small, simple viewer to preview how SVG files will look when rendered by MediaWiki
- resvg, one of the fastest and most correct SVG renderers[16], implemented in Rust
- Inkscape, which also supports some Inkscape-specific (non-standard) SVG features
- Apache Batik, an SVG toolkit implemented in Java
Others (not tested here):
- svg-explorer-extension, a free software extension for Template:W that generates thumbnails for SVG files
- svgexport, a Node.js rasterizing module
- CairoSVG, a Python converter using Cairo
- ImageMagick, a leading free software imaging software suite
- SVG.NET, a cross-platform C# library which can render SVG
- Qt SVG, a C module for Qt
- wxSVG, a C library to create, manipulate and render SVG files with the wxWidgets toolkit
- svglib, a Python library
- Aspose.SVG, a commercial SVG library for .NET
- GPAC Project on Advanced Content, for animated SVG
- Gecko, Mozilla Firefox's engine
- WebKit, the engine of Apple's Safari browser
- Blink, Chromium's engine
- chrome-svgrender, a wrapper around Google Chrome (headless) to render SVG files like Chrome would
- KSvg, part of the discontinued KHTML browser engine, formerly used by Konqueror
- Trident, Microsoft's deprecated browser engine
- Prince, a commercial converter to PDFTemplate:Clarify
- skr canvas (This project is in pre-release stage.)
References
edit- ↑ mw:User:JoKalliauer/phab/wikimedia-svg-rendering
- ↑ This number is a bit unfair since all bugs are c-librsvg2.40-bugs
- ↑ https://helpmanual.io/help/rsvg-convert/
- ↑ https://github.com/RazrFalcon/resvg/issues/376#issue-859203339
- ↑ https://inkscape.org/de/doc/inkscape-man.html
- ↑ https://xmlgraphics.apache.org/batik/tools/rasterizer.html
- ↑ https://helpmanual.io/help/rsvg-convert/
- ↑ https://github.com/RazrFalcon/resvg/issues/376#issue-859203339
- ↑ https://inkscape.org/de/doc/inkscape-man.html
- ↑ https://xmlgraphics.apache.org/batik/tools/rasterizer.html
- ↑ a b c phab:T40010#7032149
- ↑ https://github.com/RazrFalcon/resvg/issues/376#issue-859203339
- ↑ a b c without restarting inkscape
- ↑ https://github.com/RazrFalcon/resvg#svg-support
- ↑ removing File:test_suite_resvg_e-feImage-015.svg and File:test_suite_resvg_e-feImage-016.svg
- ↑ User:JoKalliauer/SVG_test_suites