cpthsv (1) - Linux Manuals

cpthsv: modify hue, saturation and colour value of GMT colour palette tables.

NAME

cpthsv - modify hue, saturation and colour value of GMT colour palette tables.

SYNOPSIS

cpthsv -T transform [-h] [-o file] [-v] [-V] [file]

DESCRIPTION

The cpthsv utility reads the RGB colour palette in the input, converts its colours to the HSV colour-space, modifies these values in some simple ways, then converts back to RGB colour space and outputs a cpt file. So cpthsv can (de)saturate, brighten, darken or hue-shift.

The program will read from stdin if a file is not specified as the final argument, and write to stdout if the -o option is not specified.

The hue value is taken to be between 0 and 360, while the saturation and value components are taken to be between 0 and 1,

OPTIONS

-h, --help

Brief help.

-o, --output file

Write the output to file, rather than stdout.

-T, --transform string

Specify a transformation to perform. One of h, s or v followed by a number and optional operation. The effect of the number depends on the operation: one of x (multiply by number), % (scale by percentage) or +/- (add or subtract value). An RGB colour with saturation 0.5 would be transformed to one with saturation 0.55 by applying s1.1x or s110% or s0.05+. If the operator is not given then % is assumed.

Transforms which take colours outside the HSV colour-space are permitted, the result is truncation (eg, increasing a saturation of 0.8 with s0.3+ results in a saturation of 1.0). The exception is hue, which is taken modulo 360.

Multiple transforms can be applied by separating transforms with commas. This is to be preferred over multiple calls to the program since the conversion between colour-spaces is necessarily lossy. Multiple trnsformations are applied in the order given in the argument.

-v, --verbose

Verbose operation.

-V, --version

Version information.

EXAMPLE

Lighten by 10% and desaturate by 20%:

  cpthsv -v -T s80,v110 -o new.cpt old.cpt

AUTHOR

J.J. Green

SEE ALSO

GMT(1).