QGSSVG(1)
π QGSSVG π
okay bestie, so this is qgssvg β it lives in the User commands section of the manual, and it's here to do one very specific, very slay thing: turn your QGIS colour-ramps into SVG gradients. no cap.
β¨ NAME β¨
qgssvg β convert QGIS colour-ramps to SVG gradients. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
qgssvg [-h] [-o path] [-v] [-V] path
π¦ DESCRIPTION π¦
so like, qgssvg converts QGIS colour-ramps into the SVG format. periodt. but here's the tea that makes it different from the rest of the cptutils fam: most of the other file formats in the cptutils package are one-gradient-at-a-time energy, but QGIS ramps can hold multiple gradients, and every single input gradient gets converted into a gradient in the output file. all of them. the whole squad. π
then once you've got that SVG, you can call up svgx(1) to extract single gradients and/or convert them into other formats. iconic teamwork fr fr.
and atypically β yes, we're using the word atypically, it's giving fancy β the path to the input QGIS colour ramp is required. you gotta give it the file. but if you don't pass the --output option, it'll write to stdout instead. no biggie.
now the sad part π: at present, only colour-ramps of type gradient can be converted β so version 2 preset ramps will be skipped. same deal for those gradients which have the discrete attribute set true. and listen, this restriction will hopefully be lifted in a later version, so don't come for the devs, they're working on it. π
π OPTIONS π
--backtrace-filepath β pick a file to write a formatted backtrace to. lowkey important: the file only gets created if there's actually a backtrace to write, which typically happens when an error occurs.--backtrace-formatformat β tell it what format to use for the backtrace written to the files specified by--backtrace-file. your choices areplain,xmlorjson. pick your fighter.--comments-readpath β read the comments from the specified path and add them to the output gradient. the format is literally just a plain text multi-line document with no comment delimiters β the program adds those for you. we love a low-effort moment. π«Ά--comments-retainβ use the comments in the input file as the comments for the output file. recycling! sustainable queen. π--comments-generateβ create a comment with summary data in the output file β that's the date of creation, plus the name and version of thecptutilspackage. little timestamped receipt, cute. β-h,--helpβ brief help. it's giving helpful.-o,--outputpath β write the output to path, rather thanstdout. (yes, this is the one that saves you from the stdout situation mentioned up in DESCRIPTION.)-v,--verboseβ verbose operation. it'll talk more. we love a chatty icon. π-V,--versionβ version information.
π₯ EXAMPLE π₯
convert a QGIS colour-ramp, foo.qgs, to a set of GIMP gradients:
qgssvg -v -o tmp.svg foo.qgs
svggimp -v -a tmp.svg
see how it's a two-step? qgssvg does the SVG thing, then svggimp takes it to GIMP gradient town. the pipeline ate and left no crumbs. π
π AUTHOR π
J.J. Green
π SEE ALSO π
and that's the whole page bestie β this was cptutils 1.82, dated 9 July 2024. mwah π go convert some ramps, you got this fr fr. π§β¨
π¦ where this page comes from
- fedora 43: cptutils 1.82-4.fc43 Β· GPL-2.0-or-later
- fedora 44: cptutils 1.82-6.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms