GRADIENT-CONVERT(1)
π GRADIENT-CONVERT(1) β user commands, bestie edition π
okay so welcome to gradient-convert, the little wrapper script that is genuinely out here doing the most so you don't have to π«Ά
β¨ NAME β¨
gradient-convert β converts gradients between formats, no cap
πΈ SYNOPSIS πΈ
gradient-convert [-b rgb] [-B] [-c] [-f rgb] [-g geometry] [-G] [-h]
[-i format] [-n rgb] [-o format] [-p] [-T rgb] [-v]
[-V] [-z] [-4] [-5] [-6] infile outfile
π¦ DESCRIPTION π¦
so gradient-convert converts gradients to other formats, periodt. it's a wrapper script β which means it makes a whole bunch of calls to the individual programs from the cptutils package, like it's the group chat coordinator of your conversion. for example, to convert a GMT colour palette (cpt) to a PNG image, the programs cptsvg and svgpng would get called in sequence to generate the file you asked for. iconic teamwork honestly π₯
the formats of the mandatory infile and outfile arguments are figured out from the file extensions β or you can just say it explicitly with the -i and -o options. your call bestie π
π OPTIONS π
first thing first, queen: in everything below, all rgb specifications should be of the form red/green/blue where the colour components are integers in the range 0 to 255. that's the whole vibe.
-b,--background rgbβ sets the background colour of cpt output. π
heads up though: this only modifies the"background"field in the output cpt file. it does not touch the transparency β for that, go look at the--transparencyoption. not the same thing, don't get it twisted π
--backtrace-file pathβ tells it a file to write a formatted backtrace to. the file only gets created if there is a backtrace created, typically when an error occurs. so like, it's a file that only shows up when things go wrong π--backtrace-format formatβ sets the format of the backtrace written to the files specified by--backtrace-file, one ofplain,xmlorjson.-B,--burstβ some of the file formatscptutilshandles may contain multiple gradients: the Photoshop (grd) and SVG formats for example. by default, the program extracts only the first gradient from such files. but when--burstis selected, all gradients get extracted. in that case theoutfileargument must be a directory β and bestie, that directory should already exist, okay? β-c,--capabilitiesβ prints the capabilities of the program to stdout. this data (in YAML format) may be used to autoconfigure other programs which wish to use this program. the format should be self-explanatory, iykyk.-f,--foreground rgbβ sets the foreground colour of cpt output. π-g,--geometry widthxheightβ specifies the size of the PNG image or SVG preview in pixels.-G,--graphvizβ prints the conversion graph to stdout in the GraphViz dot format. seedot(1)for details on creating a plot of the graph from this output. very demure, very graph π-h,--helpβ brief help. a lil snack of information.-i,--input-format formatβ specifies the format of the input file. run the program with the--helpoption for a list of supported formats.-n,--nan rgbβ sets the NaN (no data) colour of cpt output.-o,--output-format formatβ specifies the format of the output file. run the program with the--helpoption for a list of supported formats.-p,--previewβ includes a preview in the SVG output. see also the--geometryoption. π-T,--transparency rgbβ when converting to a format which does not support transparency, replaces the transparency with the specifiedrgbcolour. the swap, basically π-v,--verboseβ verbose operation. it will tell you everything, and honestly? good for it.-V,--versionβ version information.-z,--zipβ for input formats which may contain multiple gradients (grd,svg),--zipextracts all of the gradients and zips them up. so yeah, you can think of it as similar to the burst option (--burst). the zipfile to be created should be the final argument, and when unzipped it will create a directory (containing the converted gradients) with the same name as the file with the.zipextension removed. chef's kiss π§-4,--gmt4β uses GMT 4 conventions when writing the cpt output: the colour-model code is uppercase, and the colours are separated by spaces.
this is incompatible with the-5and-6options of course. pick a lane bestie π€
at present this option is the default, but that will change at some point. so specify this option if your use of the output depends on the GMT 4 layout (consumed by a custom parser, for example). don't say we didn't warn you β¨
-5,--gmt5β uses GMT 5 conventions when writing the cpt output: the colour-model code is lowercase, and the colours are separated by a solidus for RGB, CMYK, by a dash for HSV.
this is incompatible with the-4and-6options of course.
-6,--gmt6β as the-5option, but allows theHARD_HINGEandSOFT_HINGEdirectives in place of the explicitHINGE =directive.
this is incompatible with the-4and-5options of course.
π EXAMPLES π
convert a GMT colour palette to a 200Γ20 pixel PNG image:
gradient-convert -v -g 200x20 legend.cpt legend.png
convert all gradients in a Photoshop gradient to GMT cpt files in a zipfile:
gradient-convert -v -i grd -o cpt -z froob.grd froob.zip
π CAVEATS π
the component programs in the conversion will generally have a number of options available for modifying the conversion behaviour, but only the most-often used of these options can be passed to component programs from gradient-convert. so like, not everything gets an invite to the party, sorry π
also note that those options which are passed to component programs are not checked for relevance. converting a GMT cpt file to GIMP format while using the irrelevant --geometry option will not cause an error β it will simply be ignored. the option is just there, vibing, being ignored. it's giving main character who got cut from the final edit π
π«Ά AUTHOR π«Ά
J.J. Green
and that's the whole page bestie, you ate that π this was cptutils version 1.82, dated 9 July 2024 β so if you're reading this, slay, go convert some gradients, and remember: the vibe changes, the flags don't. periodt ππ
π
π¦ 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