Skip to content
Standalone binary executables for macOS and Windows of 'svgo', the SVG optimizer
Branch: master
Clone or download
twardoch Merge pull request #2 from eperret/master
updated to include support for linux. This commit fixes #1
Latest commit b35958a Aug 25, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Fixed the plugin config. It was causing some images to not be pixel p… Dec 31, 2017
src Fixed the plugin config. It was causing some images to not be pixel p… Dec 31, 2017
test 0.7.4 Oct 26, 2017
.editorconfig v0.7.2 Aug 31, 2017
.gitignore lib Aug 31, 2017
.jshintignore v0.7.2 Aug 31, 2017
.jshintrc v0.7.2 Aug 31, 2017
.npmignore v0.7.2 Aug 31, 2017
AUTHORS
LICENSE 0.7.4 Oct 26, 2017
Makefile Fixed the plugin config. It was causing some images to not be pixel p… Dec 31, 2017
README.md 0.7.4 Oct 26, 2017
package.json
pkg.json 0.7.3 Aug 31, 2017

README.md

svgop

svgop (SVG Optimizer Pipeable) is a standalone binary executable that combines the excellent svgo Nodejs-based tool for optimizing SVG vector graphics files, and pdf.js, the PDF renderer written in JS.

Rationale

SVG files, especially exported from various editors, usually contain a lot of redundant and useless information such as editor metadata, comments, hidden elements, default or non-optimal values and other stuff that can be safely removed or converted without affecting SVG rendering result.

What is svgop?

While svgo requires a Nodejs environment to run, svgop is a standalone binary executable tool for macOS (64-bit) and Windows (x86 and x64). svgop accepts SVG and PDF in stdin and outputs an optimized SVG to stdout.

It uses the default svgo config.

This repo contains a process to create svgop from svgo and pdf.js using the Nodejs pkg compiler.

Note: To make pkg work, a customized version of config.js will replace svgo’s own config.js. The customized version will need to be updated manually from time to time.

Download

DOWNLOAD the latest release for macOS (svgop-macos.zip), Windows 32-bit (svgop-win32.zip) or Windows 64-bit (svgop-win64.zip).

Usage

  • from .pdf to .svg
svgop < test.pdf > test.min.svg
  • from .svg to .svg
svgop < test.svg > test.min.svg
  • from .svgz to .svg:
gunzip -c test.svgz | svgop > test.min.svg
  • from .svg to .svgz:
svgop < test.svg | gzip -cfq9 > test.min.svgz

Building

Clone the repo on macOS, run make. The executables will be found in ./bin.

License and Copyright

Portions of this software are licensed under the terms of the Apache 2 license. Portions of this software are licensed under the terms of the MIT license. Please consult LICENSE.

  • svgop: Copyright © 2017 Adam Twardoch
  • svgo: Copyright © 2012–2017 Kir Belevich and Contributors
  • pdf.js: Copyright © 2012-2017 Mozilla Foundation and Contributors
You can’t perform that action at this time.