Scroll to navigation

SCOUR(1) User Commands SCOUR(1)

NAME

scour - Optimize and clean SVG files

SYNOPSIS

scour [INPUT.SVG [OUTPUT.SVG]] [OPTIONS]

DESCRIPTION

Scour is an SVG optimizer/cleaner that reduces the size of scalable vector graphics by optimizing structure and removing unnecessary data.

The goal of Scour is to output a file that renderes identically at a fraction of the size by removing a lot of redundant information created by most SVG editors.

Optimization options are typically lossless but can be tweaked for more agressive cleaning.

If the input/output files are not specified, stdin/stdout are used. If the input/output files are specified with a svgz extension, then compressed SVG is assumed.

OPTIONS

show program's version number and exit
show this help message and exit
suppress non-error output
verbose output (statistics, etc.)
alternative way to specify input filename
alternative way to specify output filename
Optimization:
set number of significant digits (default: 5)
set number of significant digits for control points (default: same as '--set-precision')
won't convert colors to #RRGGBB format
won't convert styles into XML attributes
won't collapse <g> elements
create <g> elements for runs of elements with identical attributes
won't remove Inkscape, Sodipodi, Adobe Illustrator or Sketch elements and attributes
won't remove elements within the defs container that are unreferenced
work around various renderer bugs (currently only librsvg) (default)
do not work around various renderer bugs (currently only librsvg)
SVG document:
won't output the XML prolog (<?xml ?>)
remove <title> elements
remove <desc> elements
remove <metadata> elements (which may contain license/author information etc.)
remove <title>, <desc> and <metadata> elements
remove all comments (<!-- -->)
won't embed rasters as base64-encoded data
changes document width/height to 100%/100% and creates viewbox coordinates
Output formatting:
indentation of the output: none, space, tab (default: space)
depth of the indentation, i.e. number of spaces/tabs: (default: 1)
do not create line breaks in output(also disables indentation; might be overridden by xml:space="preserve")
strip the xml:space="preserve" attribute from the root SVG element
ID attributes:
remove all unreferenced IDs
shorten all IDs to the least number of letters possible
add custom prefix to shortened IDs
don't remove IDs not ending with a digit
don't remove IDs given in this commaseparated list
don't remove IDs starting with the given prefix
SVG compatibility checks:
exit with error if the input SVG uses nonstandard flowing text (only warn by default)

EXAMPLES

Standard:

scour -i input.svg -o output.svg

For better compatibility with web browsers:

scour -i input.svg -o output.svg --enable-viewboxing

Maximum scrubbing:

scour -i input.svg -o output.svg --enable-viewboxing --enable-id-stripping \
--enable-comment-stripping --shorten-ids --indent=none

Maximum scrubbing and a compressed SVGZ file:

scour -i input.svg -o output.svgz --enable-viewboxing --enable-id-stripping \
--enable-comment-stripping --shorten-ids --indent=none

COPYRIGHT

Jeff Schiller, Louis Simard, 2010

MAN PAGE

Enkelena Haxhija (EnkelenaH) has produced this man page from the upstream README and the --help output for Debian with the help of pandoc(1) and help2man(1). The latter is executed at build time so --help output and this man page should stay consistent.

May 2025 scour 0.38.2