CPTCONT(1)

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

πŸ’– 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-file path β€” 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-format format β€” pick the format for the backtrace written to whatever --backtrace-file says. Your choices are plain, xml, or json.
  • --comments-read path β€” read the comments from that path and 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-write path β€” write the comments that were in the input out to path.
  • --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 the cptutils package.
  • -h, --help β€” brief help. short n sweet πŸ’…
  • --hinge value β€” set the z-value of the hinge in the cpt file. Heads up: if the input has no hinge directive (like a SOFT_HINGE or HARD_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 a SOFT_HINGE directive, 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, --output path β€” write the output to path instead of stdout.
  • -p, --partial percentage β€” the endpoints get moved that percentage of the way towards the mean colour. So 100 (which is the default) moves them all the way to the mean colour, 50 moves 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 range 0/1 (or into -1/1 if there's a hinge present), and add a RANGE directive 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 the RANGE directive, and remove that directive. If there's no RANGE, 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 for RGB, CMYK, and by a dash for HSV.

This is incompatible with the -4 and -6 options, obviously.

  • -6, --gmt6 β€” same as the -5 option, but it allows the HARD_HINGE and SOFT_HINGE directives instead of the explicit HINGE = 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