Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 858 Bytes

README.adoc

File metadata and controls

40 lines (24 loc) · 858 Bytes

SVG Compressor

A small Ruby script for compressing SVGs that contain base64 encoded PNGs

Installation

Use bundler to install dependencies:

bundle install

The node SVGO tool is also a prerequisite:

npm install -g svgo

To run from anywhere, add the script to your shell:

export PATH=$PATH:/path/to/svg-compressor

Usage

To recursively convert SVGs in all subdirectories, run:

svg-compressor.rb <quality>

The jpeg compression quality can be set using quality with an integer value of 1-100 (1 being lowest quality and highest compression rate).

The SVG XML itself is then compressed and formatted using an SVGO wrapper.

Reporting Bugs

Please feel free to open an issue for 🐛 or feature requests.