SCOUR(1)
π 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#RRGGBBformat π¨--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 thedefscontainer 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 documentwidth/heightto100%/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 byxml:space="preserve") π«--strip-xml-spaceβ strip thexml: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
π 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 π§ β¨
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
- debian trixie: scour 0.38.2-6 Β· Apache
- ubuntu resolute: scour 0.38.2-6 Β· Apache
- ubuntu stonking: scour 0.38.2-6 Β· Apache
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms