Skip to content

Instantly share code, notes, and snippets.

@klingtnet
Created July 3, 2019 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klingtnet/5ac46efcdebe9e23f076426cf2308179 to your computer and use it in GitHub Desktop.
Save klingtnet/5ac46efcdebe9e23f076426cf2308179 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
inkscape --without-gui --export-png inkscape.png --export-dpi=120 example.svg
convert -density 120 example.svg imagemagick.png
python -m venv venv && venv/bin/pip install cairosvg && venv/bin/cairosvg --dpi 120 --output cairosvg.png example.svg
curl --location --fail --silent https://github.com/RazrFalcon/resvg/archive/v0.7.0.tar.gz | tar --extract --gzip && cargo build --features=qt-backend --release --manifest-path=resvg-0.7.0/tools/rendersvg/Cargo.toml && ./resvg-0.7.0/target/release/rendersvg --dpi 120 example.svg qt.png
curl --silent --location --fail 'http://www.apache.org/dyn/closer.cgi?filename=/xmlgraphics/batik/binaries/batik-bin-1.11.tar.gz&action=download' | tar --gzip --extract batik-1.11/batik-rasterizer-1.11.jar && java -jar batik-1.11/batik-rasterizer-1.11.jar -dpi 120 -d batik.png example.svg
chromium --headless --disable-gpu --screenshot=chrome-headless.png --window-size=449x35 $PWD/example.svg
for image in *.png
do
file "$image"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment