Skip to content

A small ruby script/toolchain for compressing SVGs that contain embedded base64 encoded PNGs

Notifications You must be signed in to change notification settings

bsmth/svg-compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A small ruby script/toolchain for compressing SVGs that contain embedded base64 encoded PNGs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages