PSSVG(1)
NAME ✨
pssvg — bestie, this is the little icon that converts Photoshop® gradients into SVG. That's it, that's the whole job, and she does it beautifully. 💅
This one lives in the User commands section of the manual, iykyk. 🎀
🦋 SYNOPSIS 🦋
pssvg [-b rgb] [-f rgb] [-h] [-o path] [-t format] [-v] [-V] path
🌸 DESCRIPTION 🌸
okay so here's the tea. The pssvg program takes Photoshop grd5 gradients and converts them into SVG format. No cap.
But here's where it gets kinda iconic: unlike most of the other file formats the cptutils package deals with, grd5 files can hold multiple gradients at once, and literally all of the input gradients get converted into gradients in the output file. Then you can go grab svgx(1) and use it to pull out single gradients and convert them to whatever other format your heart desires. Obsessed. 💖
Now, Photoshop gradient files will often have a bunch of gradients all sharing the same name. Those names are the basis for the SVG titles (the id attributes), but since ids have to be unique, the program appends _01, _02, ... to the duplicate names to build the titles. Alternatively, you can use the --title option to generate a uniform sequence of titles instead. Slay.
Similarly — and this is the part where you gotta pay attention — the output SVG ids have to be valid XML ids, and specifically they must start with a character (not a number). So if the Photoshop gradient names aren't valid XML ids, the program will error. 😭 Again: an explicit --title will fix this issue. She's got you.
Also, the program reads from stdin if you don't give it a file as the final argument, and writes to stdout if you don't use the --output option. Main character energy either way. ✨
👑 OPTIONS 👑
Quick note before we go: in everything below, all rgb specifications need to be of the form red/green/blue, where the colour components are integers in the range 0 to 255. 🎨
-b,--backgroundrgb— Sets the background colour of the output. 💜--backtrace-filepath— Tells the program which file to write a formatted backtrace to. The file only gets created if there's actually a backtrace to write, which typically happens when an error goes down. 😬--backtrace-formatformat— Picks the format of the backtrace written to the files from--backtrace-file, and it's one ofplain,xmlorjson.--comments-readpath— Reads the comments from the specified path and adds 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. 🫶--comments-generate— Creates a comment in the output file with summary data: the date of creation, plus the name and version of thecptutilspackage. Receipts, basically. 🧾-f,--foregroundrgb— Sets the foreground colour of the output.-h,--help— Brief help. (We love a quick lil assist. 💖)-o,--outputpath— Writes the output topathinstead ofstdout.-t,--titleformat— This one generates the SVG gradient titles (theidattributes) according to the format you specify. Theformatargument should be aprintf(3)format string containing a single integer directive — that directive gets swapped out for the gradient number. So"id-%03i"will produce ids"id-001","id-002",...and so on. Gorgeous.
⚠️ Heads up bestie: passing a format string that doesn't contain a single integer directive results in undefined behaviour (in the C sense), so only use trusted sources for this string. No random strings from the group chat, okay? 🙈
-v,--verbose— Verbose operation. She will tell you everything. 💀-V,--version— Version information.
🌈 EXAMPLE 🌈
Convert a Photoshop gradient, foo.grd, to a set of GIMP gradients: foo-001.ggr, foo-002.ggr, ... — look at her go:
pssvg -v -t "foo-%03i" -o tmp.svg foo.grd
svggimp -v -a tmp.svg
💀 CAVEATS 💀
okay, sit down, we need to talk.
The program handles RGB, HSB, LAB, CMYK and greyscale colour stops, converting them all to RGB and then merging the results with the opacity channel to create SVG RGBA stops. But the conversion of non-RGB stops is naive and takes zero account of colour profiles, so the results are generally sub-optimal. 😭 Integrating a CMS (colour management system) into the program to do these conversions properly is currently under investigation. Fingers crossed, fr fr.
The program does not handle "Book Colours" (PANTONE, COLOR FINDER, etc) — for legal reasons. 🚫
The SVG output format does not support back/foreground colours. Consequently, if the input specifies any stops with back/foreground colours, those get converted to the colour specified by the --background and --foreground options, respectively. That's the deal. 💅
The smoothness parameter used by Photoshop (which seems to parameterise some kind of spline) is not yet handled — the output contains only linear splines, corresponding to a smoothness of 0%. So the SVG output will sometimes look more "angular" than the Photoshop input. Fixing this will require research into the precise nature of the spline parameterisation used in the input. It's giving ✨research era✨.
Noise gradients would seem to be difficult to convert to SVG without using a huge number of stops in the output, so these will probably not be supported by this program. We said what we said.
🎀 NOTES 🎀
Adobe Photoshop® is a trademark of Adobe Systems Inc. PANTONE® is a trademark of Pantone LLC. COLOR FINDER® is a trademark of Toyo Ink Mfg. Co., Ltd.
This program was written using the reverse-engineered specification of the grd5 format by Valek Filippov, Alexandre Prokoudine and Michel Mariani. Legends, honestly. 👑
🫶 AUTHOR 🫶
J.J. Green
⭐ SEE ALSO ⭐
and that's the whole page, bestie 💖 this one's from the cptutils package, version 1.82, dated 9 July 2024 — go forth and convert some gradients, you absolute icon 🦋✨
📦 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