QGSSVG(1)

πŸ“¦ version 1.82, in fedora 43, fedora 44

πŸ’– 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-file path β€” 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-format format β€” tell it what format to use for the backtrace written to the files specified by --backtrace-file. your choices are plain, xml or json. pick your fighter.
  • --comments-read path β€” 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 the cptutils package. little timestamped receipt, cute. ⭐
  • -h, --help β€” brief help. it's giving helpful.
  • -o, --output path β€” write the output to path, rather than stdout. (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 🌟

svgx(1)


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