[Kde-games-devel] A simple svg optimizer

Luciano Montanaro mikelima at gmail.com
Wed Dec 19 21:00:49 CET 2007


Il Wednesday 19 December 2007 20:45:44 Aaron J. Seigo ha scritto:
> On Wednesday 19 December 2007, Luciano Montanaro wrote:
> > I've been thinking for a while that we should do domething to reduce
> > size/loading time for our SVG graphics, if possible, and yesterday
> > evening I put together a small program to strip svg file of
> > tags/attributes that are not affecting the final look.
>
> note that tackat has done pretty much the same thing for marble, though he
> just used a perl script iirc. it's in there with the marble source
> somewhere.

Oh, I didn't know about that. I actually was thinking of doing that in Perl, 
but then I was not sure I could depend on the XML modules. Since Qt is 
already a dependency, this should not have issues... 

And then, i wanted to try out the Qt QDOM stuff. 

Anyway, I'll check the marble sources too. Thank you for the info. 

Do you think it could be useful to strip the icons too? As I said, for 
compressed icons my program shaves off a 5% of the size.

>
> something that you could also do that can reduce things significantly is to
> get reduce the precision of the floating point values. it probably isn't
> necessary to have all 16 decimal places that inkscape tends to put in
> there ;) 3 or 4 is probably plenty of sub-pixel perfection. this shaves
> another 7% or so off the size of the files ime, even more with files with
> tons of items.

Well, there are only 6 decimals or so, but you are right. Actually I was 
thinking about that too. And maybe colors can be simplified too. At least, 
"#000000;" could be converted to "#000;"



More information about the kde-games-devel mailing list