It makes SVG W3C-Valid, removes librsvg-Bugs and cleans up useless stuff.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Botsvg2validsvg.sh
CleanerFull.sh
Defssvgdefs.txt
FFlow2TextBySed.sh
Flow2TextByInkscape.sh
Full.sh
GUI.sh
InkscapeBatchConverter.sh
IskartOptimizer.sh
IskartRun.sh
Istkart.sh
LICENSE
Matrix2TransformScale.sh
NFC.sh
NoCleanerFull.sh
NoGroup.sh
NoScourFull.sh
OptimizerFull.sh
PDF2SVG.sh
Pathmerge.sh
PosibleUngroup.sh
README.md
RasterOptimizer.sh
ResizeByInkscape.sh
Rounding.sh
ScourFull.sh
SimplifyByInkscape.sh
Space2Underline.sh
Steifer.sh
T35245.sh
T36947.sh
T55899.sh
Text2Path.sh
UngroupByInkscape.sh
Vacuumdefs.sh
_Inkscapecomands.txt
all.sh
cleaner4compression.sh
dCleaner4compression.sh
defcleaner.sh
defomg.sh
defscour.sh
delCircles.sh
delObj.sh
delText.sh
delX.sh
do4compression.sh
dscour4compression.sh
einzeilTags.sh
fontReplace.sh
inkscour4compression.sh
iskatrun.sh
keepCSS.sh
keepUngroupByScour.sh
languageSwitch.sh
maps.sh
meta.sh
mincleaner4compression.sh
mino4compression.sh
minscour4compression.sh
o4compression.sh
orgEkipsFilterExtractimageNoprefs.sh
save.sh
scour4compression.sh
slowUngroupByInkscape.sh
split.sh
svg2validsvg.sh
validByScour.sh
validBycleaner.sh
viewBox.sh

README.md

cleanupSVG

It makes SVG W3C-Valid, removes librsvg-Bugs and cleans up useless stuff.

Download master.zip or the three files seperatly. Each of the files work independedly.

svg2validsvg.sh ist a simple stringreplace

InkscapeBatchConverter.sh uses Inkscape for rewriting SVG to plain-SVG

scour4compression.sh uses scour for removing useless staff/metadata, enables viewbox, groups elemtents,...

cleaner4compression.sh uses RazrFalcon/svgcleaner

o4compression.sh uses svgo)

The following script can be run in shell-terminal:

#!/bin/bash

export minfilesize=0 #1..min file size (1...no line breaks)
export precisiondigits=2 #number of dicits for control points
export precisiondigitsN=4 #number of dicits
export meta=0 #0 removes metadata

./svg2validsvg.sh

./InkscapeBatchConverter.sh

./scour4compression.sh
./cleaner4compression.sh #only tested on Windows
./o4compression.sh #only tested on Windows
./cleaner4compression.sh #it is fast and makes a good readable file

./svg2validsvg.sh

This script is tested on
-Ubuntu 16.04
-Windows with Cygwin

Similar scripts
-SVGOMG
-svgo
-scour
-svgcleaner

Installation on Windows:

1)Inkscape
1a)Download&Install https://inkscape.org/release/0.92.3/ (Don't forget to choose your language)
2)scour
2a)Download&Install Python 2.7: https://www.python.org/downloads/
2b)Add "C:\Python27" and "C:\Python27\Scripts" to enviroment variable %Path%
-(Option-i)Run cmd.exe; type set PYTHONPATH=C:\Python27 and set PATH=%PATH%;%PYTHONPATH%;C:\Python27\Scripts
-(Option-ii)Run Sysdm.cpl; to to the advanced-Tab; Environemt variables...; click Path, click Edit; add C:\Python27 and C:\Python27\Scripts
2c)Run cmd.exe
2c,i)python -m pip install --upgrade pip
2c,ii)pip install --upgrade https://github.com/codedread/scour/archive/master.zip
3)svgcleaner
3a)Download "Visual Studio Community 2017" https://www.visualstudio.com/downloads/ (Don't forget to choose your language)
3b)Add Desktop development with C++, see https://github.com/rust-lang/rust/issues/49519#issuecomment-377569726 3c)Download&Install https://www.rust-lang.org/ (Don't forget to choose your language)
3d)Add "%USERPROFILE%.cargo\bin" to enviroment variable %Path%
-(Option-i)Run cmd.exe; type set PATH=%PATH%;%USERPROFILE%\.cargo\bin
-(Option-ii)Run Sysdm.cpl; to to the advanced-Tab; Environemt variables...; click Path, click Edit; add %USERPROFILE%\.cargo\bin
3e)cmd.exe: cargo install svgcleaner --force --git https://github.com/RazrFalcon/svgcleaner
4)svgo
4a)Install node.js: https://nodejs.org/ (Don't forget to choose your language)
4b)cmd.exe: npm install -g svgo
5)Cygwin
5a)Download&Install (32bit or 64bit) https://cygwin.com/install.html (in some cases you have to deactivate Avast)

Update

Windows:

python -m pip install --upgrade pip
#pip install --upgrade https://github.com/codedread/scour/archive/master.zip
pip3 install --upgrade https://github.com/codedread/scour/archive/master.zip
#cargo install svgcleaner --force
cargo install svgcleaner --force --git https://github.com/RazrFalcon/svgcleaner
npm install -g svgo

Linux:

#python -m pip install --upgrade pip
#sudo python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pip --user
#pip install --upgrade https://github.com/codedread/scour/archive/master.zip
#sudo pip3 install --upgrade https://github.com/codedread/scour/archive/master.zip
pip3 install --upgrade https://github.com/codedread/scour/archive/master.zip --user
cargo install svgcleaner --force --git https://github.com/RazrFalcon/svgcleaner
sudo npm i -g npm 
sudo npm install -g svgo