1SVGX(1) User commands SVGX(1)
2
3
4
6 svgx - extract gradients from SVG files.
7
9 svgx [-a] [-b rgb] [-f rgb] [-g geometry] [-h] [-l] [-n rgb] [-o file]
10 [-p] [-s name] [-t type] [-T rgb] [-v] [-V] file
11
13 The svgx program extracts and converts gradients in an SVG file. Unlike
14 most of the other file formats handled by the cptutils package, SVG
15 files may contain multiple gradients, so this program operates a little
16 differently to the other programs in the package.
17
18 There are 4 modes of operation: The default is to extract the first
19 gradient found in the file, or one can specify -l to list the names of
20 all gradients in the file; -s to extract the gradient with the
21 specified name or -a to extract all of the gradients.
22
23 The output format is specified by the -t option as listed below (in
24 fact there are several aliases for each format: jgd for psp, ggr for
25 gimp, and so on). The svgcpt, svggimp, svggpt, svgcss3, svgpsp, svgpov,
26 svgpng, svgqgs, svgsao, svgmap and svgsvg programs are wrappers around
27 svgx which use the -t switch to specify output type.
28
29 Atypically, the input SVG file is a mandatory argument. The program
30 will write to stdout if the -o option is not specified except when -a
31 has been specified: then files will be produced (with names taken from
32 those of the gradients).
33
34 Note that some of the SVG conversions require that the en_US.utf8
35 locale be enabled. How this is done will depend on your operating
36 system. One would run
37
38 apt-get install locales
39 dpkg-reconfigure locales
40
41 on Debian-based systems, for example.
42
44 In the following, all rgb specifications should be of the form
45 red/green/blue where the colour components are integers in the range 0
46 to 255.
47
48 -a, --all
49 Extract all gradients, which will have filenames derived from the
50 gradient names. If this option is used then the argument of the -o
51 option will be interpreted as the output directory.
52
53 -b, --background rgb
54 Set the background colour of cpt output.
55
56 Note that this only modifies the "background" field in the output
57 cpt file, it does not affect the transparency (see the -T option in
58 that regard).
59
60 --backtrace-file path
61 Specify a file to which to write a formatted backtrace. The file
62 will only be created if there is a backtrace created, typically
63 when an error occurs.
64
65 --backtrace-format format
66 Specify the format of the backtrace written to the files specified
67 by --backtrace-file, one of plain, xml or json.
68
69 -f, --foreground rgb
70 Set the foreground colour of cpt output.
71
72 -g, --geometry widthxheight
73 Specify the size of the PNG image or SVG preview in pixels.
74
75 -h, --help
76 Brief help.
77
78 -l, --list
79 List the names of all gradients in the file.
80
81 -n, --nan rgb
82 Set the NaN (no data) colour of cpt output.
83
84 -o, --output path
85 Write the output to path, rather than stdout.
86
87 If the -a option is specified then the path argument must be a
88 directory (which exists) and the output files will be written into
89 this directory.
90
91 -p, --preview
92 Include a preview in the SVG output. See also the --geometry
93 option.
94
95 --strict
96 Do not create files which break limits of the format specification.
97 In particular, do not create POV-Ray headers with more than 255
98 stops, do not create Tecplot maps with more than 50 points.
99
100 -s, --select name
101 Extract the gradient with the specified name, see the -l output for
102 a list of possible values.
103
104 -t, --type format
105 Set the output format, which should be one of cpt, css3, ggr, gpt,
106 map, psp, pov, png, qgs, sao or svg.
107
108 -T, --transparency rgb
109 When converting to a format which does not support transparency,
110 replace the transparency with the specified rgb colour.
111
112 -v, --verbose
113 Verbose operation.
114
115 -V, --version
116 Version information.
117
119 Inspect an SVG file for gradients:
120
121 svgx -v -l old.svg
122
123 Extract the gradient "Sunny Road" from the same SVG file, converting
124 the result to cpt: (note that the gradient name needs to be quoted)
125
126 svgx -v -t cpt -s "Sunny Road" -o sunny_road.cpt old.svg
127
128 Extract all of the svg gradients from the file kittens.svg and give
129 each of them a preview:
130
131 svgx -v -t svg -a -p kittens.svg
132
134 An ill-formed SVG gradient may be translated to rubbish while not
135 reporting an error.
136
138 J. J. Green
139
141 cptsvg(1), gimpsvg(1), pspsvg(1).
142
143
144
145CPTUTILS 8 July 2020 SVGX(1)