CPTUPDATE(1)
π CPTUPDATE β the glow-up your colour palette table has been waiting for π
okay bestie, so this is the cptupdate manual page, from the User commands section of the manual, and I'm about to make it make sense. grab a strawberry π, sit down, we're doing this.
β¨ NAME β¨
cptupdate β create a GMT colour palette table (cpt) file with a different version to the input. it's giving "same palette, new era". π
β¨ SYNOPSIS β¨
cptupdate [-h] [-H] [-m model] [-o path] [-S] [-v] [-V] [-z] [-Z] [-4]
[-5] [-6] [path]
β¨ DESCRIPTION β¨
so basically, the cptupdate program updates the colour palette in the input to a more recent (or older) version, and if you want, it can also add/remove features to the input while it's at it. lowkey a makeover AND a time machine. π°οΈβ¨
and here's the iconic part: the program reads any version of the format, so you can also use it to add hinges, or normalise/denormalise version 6 input, or even convert to versions 5 or 4. no gatekeeping, every version is welcome at this party. π
if you don't specify a file as the final argument, the program will read from stdin. and if you don't give it the --output option, it writes to stdout. classic. π
β¨ OPTIONS β¨
okay here's the full menu, no skips, no crumbs left behind:
--backtrace-filepath β specify a file to which to write a formatted backtrace. the file will only be created if there is a backtrace created, typically when an error occurs. so like, it's the receipts file, but only for when things go wrong. π--backtrace-formatformat β specify the format of the backtrace written to the files specified by--backtrace-file, one ofplain,xmlorjson. pick your aesthetic.--comments-readpath β read the comments from the specified path and add them to the output gradient. the format is simply a plain text multi-line document without any comment delimiters (those will be added by the program). so you bring the words, it brings the little#decorations. π--comments-writepath β write the comments in the input to the specified path.--comments-retainβ use the comments in the input file as the comments for the output file. same energy, carried forward. π«Ά--comments-generateβ create a comment with summary data (the date of creation, name and version of thecptutilspackage) in the output file. it writes its own lil autograph β¨-h,--helpβ brief help. just a lil summary, not the whole saga.-H,--hinge-hardβ adds aHARD_HINGEto the ouput provided the output version is at least 6. (no hinge, no glory, and it's a v6+ only situation, sorry.)-m,--modelmodel β on writing the output, convert all colours to the specified model, one of"rgb"or"hsv". this has no effect on non-colour segments. know the difference bestie.-o,--outputpath β write the output to path, rather than stdout.-S,--hinge-softβ adds aSOFT_HINGEto the ouput provided the output version is at least 6. soft launch of a hinge, literally. π-v,--verboseβ verbose operation. it will yap (helpfully).-V,--versionβ version information.-z,--z-normaliseβ normalise the z-values in the cpt output into the range 0/1 (or to -1/1 if a hinge is present) and add aRANGEdirective if not present in the input. this is the form used in GMT master files.
β οΈ this option requires that output cpt version is at least 5. no v5, no normalising, periodt.
-Z,--z-denormaliseβ set the z-values in the cpt output into the range given by theRANGEdirective, and remove that directive. if there is noRANGEthen this option does nothing. truly does nothing. it's just standing there. π§-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 option allows one to downgrade to version 4. if the input is normalised it will be denormalised, if the input has hinges, those will be removed. yeah, it's a full glow-<em>down</em>. π-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, by a dash for HSV. this option allows one to downgrade from version 6 (in which case hard/soft hinges will be converted to explicit hinges at zero) or upgrade from version 4. the middle child of versions, and honestly? it's thriving. π-6,--gmt6β as the-5option, but allows theHARD_HINGEandSOFT_HINGEdirectives in place of the explicitHINGE =directive. this option is the default, so redundant (but one might wish to fix version 6 in anticipation later versions of the format). it's the default bestie. you don't have to say it, but you can. π
β¨ EXAMPLE β¨
say you want to update a version 4 cpt to version 6, adding a hard hinge and normalising the result, the typical format for a master file. the main character move is:
cptupdate -v -z -H -o new.cpt old.cpt
look at that. verbose, normalised, hinged, output to new.cpt, input from old.cpt. ate. π₯
β¨ AUTHOR β¨
J.J. Green β the icon, the legend, the one who wrote this. π
and that's the whole thing bestie, no notes. this page is from cptutils version 1.82, dated 9 July 2024, and it lives in the CPTUPDATE(1) section of the manual. go forth and update your palettes. mwah πππ¦
π¦ 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