CPTCONT(1)
π CPTCONT(1) β like, the cptutils manual, bestie edition β¨
User commands π
πΈ NAME πΈ
cptcont β makes a continuous GMT colour palette table (.cpt) file out of a non-continuous one. It's giving glow-up energy for your gradients π
π¦ SYNOPSIS π¦
cptcont [-h] [-M] [-o path] [-p percent] [-v] [-V] [-z] [-Z] [-4] [-5] [-6]
[path]
β¨ DESCRIPTION β¨
okay so basically, cptcont takes a colour palette that's all jumpy and discontinuous and turns it into a smooth continuous one. How? It finds the spots where the segments don't line up (the β¨discontinuitiesβ¨) and replaces those endpoint colours with their mean colour. So everything just... flows. Iconic behaviour honestly π
If you don't hand it a file as that final argument, it'll read from stdin. And if you don't pass the --output option, it writes straight to stdout. No cap π
π OPTIONS π
--backtrace-filepath β name a file where the formatted backtrace gets written. The file only shows up if a backtrace actually happens, which is usually when something errors out. π--backtrace-formatformat β pick the format for the backtrace written to whatever--backtrace-filesays. Your choices areplain,xml, orjson.--comments-readpath β read the comments from thatpathand add them into the output gradient.
The format is just a plain text multi-line document, no comment delimiters needed β the program adds those itself. π«Ά
--comments-writepath β write the comments that were in the input out topath.--comments-retainβ take the comments from the input file and use them as the comments for the output file. Reuse era β»οΈ--comments-generateβ generate a comment with summary data in the output file: the date of creation, plus the name and version of thecptutilspackage.-h,--helpβ brief help. short n sweet π--hingevalue β set the z-value of the hinge in the cpt file. Heads up: if the input has no hinge directive (like aSOFT_HINGEorHARD_HINGE), this option literally does nothing. π
When you're normalising (with --z-normalise), this is the z-value in the input that gets mapped to zero. That z-value has to be one of the stops in the input, fr.
When you're denormalising (with --z-denormalise), this is the value in the output that zero in the input maps to. You can think of this option as the counterpart to the +hvalue appended to the -C option for makecpt(1). iykyk β¨
--hinge-activeβ if the input cpt has aSOFT_HINGEdirective, then activate that hinge (which means the two halves of the gradient on either side of the hinge get scaled independently). π
If the input doesn't have that directive, this option does nothing at all.
-M,--midpointβ split every input segment into two output segments, with the colour at the shared point being the colour of the original segment. This gets you a more faithful conversion of gradients that have "corners", like diverging gradients β but it costs you bigger files. no such thing as a free lunch bestie π-o,--outputpath β write the output topathinstead ofstdout.-p,--partialpercentage β the endpoints get moved that percentage of the way towards the mean colour. So100(which is the default) moves them all the way to the mean colour,50moves them half-way there, and so on. β¨
Negative values and values above 100 are allowed β they can give you some interesting effects, but ngl they're not really suitable for publication-quality plots. π
-v,--verboseβ verbose operation. she tells you everything π¬-V,--versionβ version information.-z,--z-normaliseβ normalise the z-values in the cpt output into the range0/1(or into-1/1if there's a hinge present), and add aRANGEdirective if the input didn't have one. This is the form used in GMT master files. π
This option requires that the output cpt version is at least 5.
-Z,--z-denormaliseβ set the z-values in the cpt output into the range given by theRANGEdirective, and remove that directive. If there's noRANGE, then this option does nothing.-4,--gmt4β use 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 -5 and -6 options, obviously. π
As of right now this option is the default, but that's gonna change at some point. So specify this option if your use of the output depends on the GMT 4 layout β say, if it's being consumed by a custom parser.
-5,--gmt5β use GMT 5 conventions when writing the cpt output: the colour-model code is lowercase, and the colours are separated by a solidus forRGB,CMYK, and by a dash forHSV.
This is incompatible with the -4 and -6 options, obviously.
-6,--gmt6β same as the-5option, but it allows theHARD_HINGEandSOFT_HINGEdirectives instead of the explicitHINGE =directive.
This is incompatible with the -4 and -5 options, obviously.
π₯ EXAMPLE π₯
Create an almost-continuous table:
cptcont -v -p 66 -o new.cpt old.cpt
π§ AUTHOR π§
J.J. Green
and that's the whole page, bestie π this was the cptutils 1.82 manual, dated 9 July 2024 β 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