SCOUR(1)

πŸ“¦ version 0.38.2, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ‘‘ SCOUR(1) β€” the User Commands manual page, but make it fashion πŸ’…

okay bestie, sit down, we're learning scour today and honestly? it's giving glow-up for your SVG files ✨


🌸 NAME 🌸

scour β€” optimize and clean SVG files πŸ§ΉπŸ’–


✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So. Scour is an SVG optimizer/cleaner, and what it does is shrink your scalable vector graphics by optimizing the structure and yeeting all the unnecessary data. no cap. πŸ—‘οΈβœ¨

The whole goal, the vision, the main character energy here: output a file that renders identically but at a fraction of the size, by removing a LOT of redundant information that basically every SVG editor on earth leaves lying around like laundry on the floor πŸ™ˆ

The optimization options are typically lossless, but bestie you can tweak them for more aggressive cleaning if you're feeling bold πŸ”₯

If you don't specify the input/output files, then stdin/stdout get used instead. And if the input/output files are specified with a svgz extension, then compressed SVG is assumed 🫢


πŸ’… OPTIONS πŸ’…

  • --version β€” show the program's version number and exit πŸ‘‹
  • -h, --help β€” show this help message and exit πŸ†˜
  • -q, --quiet β€” suppress non-error output 🀫
  • -v, --verbose β€” verbose output (statistics, etc.) πŸ“Š
  • -i INPUT.SVG β€” alternative way to specify the input filename πŸ“₯
  • -o OUTPUT.SVG β€” alternative way to specify the output filename πŸ“€

πŸŽ€ Optimization πŸŽ€

  • --set-precision=NUM β€” set number of significant digits (default: 5) πŸ”’
  • --set-c-precision=NUM β€” set number of significant digits for control points (default: same as --set-precision) 🎯
  • --disable-simplify-colors β€” won't convert colors to #RRGGBB format 🎨
  • --disable-style-to-xml β€” won't convert styles into XML attributes πŸ–ŒοΈ
  • --disable-group-collapsing β€” won't collapse <g> elements πŸ«‚
  • --create-groups β€” create <g> elements for runs of elements with identical attributes 🧩
  • --keep-editor-data β€” won't remove Inkscape, Sodipodi, Adobe Illustrator or Sketch elements and attributes 🏒
  • --keep-unreferenced-defs β€” won't remove elements within the defs container that are unreferenced πŸ“¦
  • --renderer-workaround β€” work around various renderer bugs (currently only librsvg) (default) πŸ› οΈ
  • --no-renderer-workaround β€” do not work around various renderer bugs (currently only librsvg) πŸ™…

🌈 SVG document 🌈

  • --strip-xml-prolog β€” won't output the XML prolog (<?xml ?>) βœ‚οΈ
  • --remove-titles β€” remove <title> elements 🏷️
  • --remove-descriptions β€” remove <desc> elements πŸ“
  • --remove-metadata β€” remove <metadata> elements (which may contain license/author information etc.) πŸ—‚οΈ
⚠️ okay so heads up, --remove-metadata can take your license/author info with it. be normal about that, bestie.
  • --remove-descriptive-elements β€” remove <title>, <desc> and <metadata> elements 🧼
  • --enable-comment-stripping β€” remove all comments (<!-- -->) πŸ’¬
  • --disable-embed-rasters β€” won't embed rasters as base64-encoded data πŸ–ΌοΈ
  • --enable-viewboxing β€” changes document width/height to 100%/100% and creates viewbox coordinates πŸ“

πŸ’– Output formatting πŸ’–

  • --indent=TYPE β€” indentation of the output: none, space, tab (default: space) ⬜
  • --nindent=NUM β€” depth of the indentation, i.e. number of spaces/tabs: (default: 1) πŸ“
  • --no-line-breaks β€” do not create line breaks in output (also disables indentation; might be overridden by xml:space="preserve") 🚫
  • --strip-xml-space β€” strip the xml:space="preserve" attribute from the root SVG element 🧽

🫢 ID attributes 🫢

  • --enable-id-stripping β€” remove all unreferenced IDs πŸͺͺ
  • --shorten-ids β€” shorten all IDs to the least number of letters possible πŸ”€
  • --shorten-ids-prefix=PREFIX β€” add custom prefix to shortened IDs 🏷️
  • --protect-ids-noninkscape β€” don't remove IDs not ending with a digit πŸ”’
  • --protect-ids-list=LIST β€” don't remove IDs given in this comma-separated list πŸ“‹
  • --protect-ids-prefix=PREFIX β€” don't remove IDs starting with the given prefix πŸ›‘οΈ

⭐ SVG compatibility checks ⭐

  • --error-on-flowtext β€” exit with error if the input SVG uses nonstandard flowing text (only warn by default) 🚨

πŸ”₯ EXAMPLES πŸ”₯

Standard, the classic, the moment:

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

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 🧠✨


okay that's the whole thing, bestie, go forth and shrink those SVGs πŸŒΈπŸ¦‹ this was scour version 0.38.2, dated May 2025 β€” mwah, slay, periodt πŸ’–πŸ‘‘

πŸ“¦ where this page comes from