toy / image_optim

Optimize images using multiple utilities
https://github.com/toy/image_optim
MIT License
1.52k stars 109 forks source link

[Enhancement] Better SVG support #156

Closed brian-kephart closed 6 years ago

brian-kephart commented 6 years ago

First, thanks a lot for this tool, it's made my life easier.

Currently the only tool in the mix for optimizing SVGs is SVGO. Instructions for this library require a global NPM installation which is difficult in some environments (Heroku, in my case). I haven't yet been able to make this tool work without installing it globally.

It seems like there should be another tool for SVGs (maybe this?), or alternate instructions for installing SVGO non-globally.

toy commented 6 years ago

I'm glad that it is helpful :)

About svgo – I saw a great idea in ImageOptim.app to pack svgo into a single shell script and bundle the result.

About svgcleaner – looks interesting, plus there is a comparison with scour which can also be an alternative.

brian-kephart commented 6 years ago

Thanks for the response. I'm not really concerned about having multiple tools, though I suppose it wouldn't hurt. One tool is fine if I can install it in my production environment. The alternative tool suggestion was just in case SVGO couldn't be made to work.

Is this the SVGO bundle you were referring to?

brian-kephart commented 6 years ago

After some experiments, I found that:

  1. The other utilities I tried didn’t reduce file size as much as SVGO.
  2. Using SVGO non-globally was really easy once I figured it out.

I’ll submit a PR updating the README with alternate instructions.