Kilian / Trimage

A cross-platform tool for optimizing PNG and JPG files.
http://trimage.org
MIT License
706 stars 55 forks source link

Support SVG compression #35

Closed jancborchardt closed 8 years ago

jancborchardt commented 9 years ago

I use trimage a bunch for ownCloud icons (thx @Kilian ;) – one problem is that I still need to compress SVG icons manually using the console and scour:

scour -i $svg.opttmp -o $svg --create-groups --enable-id-stripping --enable-comment-stripping --shorten-ids --remove-metadata;

Would be awesome if Trimage could support SVG out of the box so I can just easily drag-n-drop like with PNGs.

Kilian commented 9 years ago

scour is really cool and i like the idea of SVG compression, but scour is lossy it seems, and Trimage is explicitly not so. Would it be possible to have SVG compression in scour without it rewriting the actual "image" data?

jancborchardt commented 8 years ago

The web service Compressor.io also uses Scour: https://compressor.io/about – not sure if there’s a lossless app.

Does using Scour with less flags result in it being less lossy maybe? I have no idea about the internals either.

johandouma commented 5 years ago

SVGO is lossless. But I'm not sure how easy it would be to integrate npm packages.

https://github.com/svg/svgo

jancborchardt commented 5 years ago

At least in the past we had some issues with svgo when using it for Nextcloud icons as it changed shapes sometimes.

Don't remember if that was related to some flags, but something to look out for.