[Kde-games-devel] A simple svg optimizer
Luciano Montanaro
mikelima at gmail.com
Wed Dec 19 22:44:37 CET 2007
Il Wednesday 19 December 2007 21:34:56 Aaron J. Seigo ha scritto:
> On Wednesday 19 December 2007, Luciano Montanaro wrote:
> > Il Wednesday 19 December 2007 20:45:44 Aaron J. Seigo ha scritto:
> > 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.
>
> we discussed this on the artists list probably some 6 months ago, actually
> =) it was decided to this for release tarballs, but not for the icons in
> svn.
>
Yes, I remember about that. Is it six months already? Wew!
> > > 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;"
>
> yep. lots of room for optimizing away data that's really only helpful
> during editting.
Yes, I've a few things in mind...
One problem is the unused stuff inkscape leaves around... like unused
gradients. Then there are ids that are used nowhere... Well, I suppose one
just has to look at the typical inkscape file.
By the way, mimetypes/application-x-mswinurl.svgz has -- I think -- more than
400 unused definitions laying around.
Oh, I've looked at marble sources. I think I've found what you were referring
to, but it's just an sh script with a few Perl substitutions, similar to
those I did on occasion to some of my files. I tried my script also there,
and I think an additional 500K may be shaved from there too.
Luciano
More information about the kde-games-devel
mailing list