User:JoKalliauer/SVG test suites
SVG Test suites[edit]
summary[edit]
SVG | librsvg 2.50 | resvg 0.14.0 | Inkscape 1.0 | batik 1.13; 1.14 |
---|---|---|---|---|
W3C correctness | 0,662 | 0,831 | 0,745 | 0,801 |
W3C cpu-time (512px) | 1m 46,776s | 1m 04,490s | 7m 57,465s | 6m 51,560s |
RazrFalcon correctness | 0.754 | 0.956 | 0.729 | 0.703 |
RazrFalcon time | 4min 05sek | 2min 30sek | 46min 22sek | 61min 29sek |
featured correctness | 0.92 | 1.00 | ||
featured time | 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] | 0.55[2] | 0.88 | 0.78 |
commands[edit]
command | 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[edit]
https://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[edit]
1338files from https://github.com/RazrFalcon/resvg/tree/master/tests/svg 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 |
Category:Featured pictures on Wikimedia Commons - vector[edit]
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
test files by User:Glrx[edit]
User:Glrx might be one of the experts about special SVG-features and details about SVG-standard, they are known for contributing usefull 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[edit]
This 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[edit]
There 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[edit]
This 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[edit]
SVG | resvg | librsvg | Ink | batik | |
---|---|---|---|---|---|
Template:Vertical header | |||||
Template:Vertical header | |||||
Template:Vertical header |
more Render[edit]
tested:
- w:librsvg, a small, simple viewer to preview how SVG files will look when rendered by MediaWiki
- resvg, is one of the fastest and most correctes SVG-render[16]
- Inkscape, supports also Inkscape-features, which are not in the SVG-1.1-DTD-Standard
- batik, a java-based toolkit for svg-rendering
untested:
- Svg-explorer-extension, a free LGPL extension for Template:W that generates thumnails for SVG files
- svgexport, a Node.js module
- cairosvg, a Python library
- ImageMagick, image-converter
- chrome-svgrender, renders SVG files using Headless Chrome
- SVG.NET, a basic renderer
- QtSVG, a basic renderer
- wxsvg, a basic renderer
- svglib, a Python-libary
- aspose.svg, a .NET-API
- w:en:GPAC_Project_on_Advanced_Content, for animated SVG
- w:en:Trident_(software), by Micorsoft
- w:en:Gecko_(software), by Mozilla
- w:en:WebKit, by Apple
- w:en:Blink_(browser_engine), by Google
- w:en:Presto_(browser_engine), by Opera
- KSVG, by KDE
- w:en:Prince_(software)
- w:en:Amaya_(web_editor)
- w:en:Renesis_Player
- https://phantomjs.org/
- https://www.npmjs.com/package/svgexport
- https://github.com/Brooooooklyn/canvas/ (This project is in pre-release stage. And there may some bugs existed.)
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