dotfiles/dot_bin/executable_svg2tiff

16 lines
480 B
Bash

#!/bin/sh
# Convert all arguments (assumed SVG) to a TIFF
# Requires Inkscape and ImageMagick 6.8 (doesn't work with 6.6.9)
# lovingly ripped off from here:
# https://gist.github.com/matsen/4263955
for i in $@; do
BN=$(basename $i .svg)
inkscape --without-gui --export-area-drawing --export-png="$BN.png" --export-dpi 300 $i
convert -compress LZW -alpha remove $BN.png $BN.tiff
convert $BN.png -background white -alpha remove $BN.png
mogrify -alpha off $BN.tiff
done