Now I am compressing the whole icon theme with the help of the svgcleaner (and Inkscape and Sublime Text). I believe that precision of 1/10 pixel is enough. Svgcleaner provides good results in the most cases, but sometimes error accumulates and resulting in the distorted shapes.
I use these options to round coordinates to 0.1 (and to satisfy my other needs):
--remove-unresolved-classes no
--multipass
--apply-transform-to-paths yes
--coordinates-precision 1
--path-coordinates-precision 1
Version of svgcleaner is 0.9.1.
Generic example follows. We can define the same path using absolute coordinates:
M 1,1 L 1.25,1.25 L 1.25,2.25 L 2.5,2.5 L 2.5,3.5 L 3.75,3.75
or relative paths:
m 1,1 l .25,.25 l 0,1 l 1.25,.25 l 0,1 l 1.25,.25
In the case with absolute coordinates svgcleaner makes it's best resulting in:
m1 1 .3.3v1l1.2.2v1l1.3.3
In the case with relative paths rounding error (0.25→0.3) accumulated resulting in:
m1 1 .3.3v1l1.3.3v1l1.3.3
Possible solution:
convert original paths to absolute (new action);
round coordinates (how is it done now);
convert rounded paths to relative paths (how is it done now with default --paths-to-relative yes).
Now I am compressing the whole icon theme with the help of the svgcleaner (and Inkscape and Sublime Text). I believe that precision of 1/10 pixel is enough. Svgcleaner provides good results in the most cases, but sometimes error accumulates and resulting in the distorted shapes.
I use these options to round coordinates to 0.1 (and to satisfy my other needs):
Version of svgcleaner is 0.9.1.
Generic example follows. We can define the same path using absolute coordinates:
or relative paths:
In the case with absolute coordinates svgcleaner makes it's best resulting in:
In the case with relative paths rounding error (0.25→0.3) accumulated resulting in:
Possible solution:
--paths-to-relative yes
).