LinuxCommandLibrary

gvcolor

Color directed graphs based on node attributes

TLDR

Colorize one or more ranked digraph (that were already processed by dot)

$ gvcolor [path/to/layout1.gv path/to/layout2.gv ...] > [path/to/output.gv]
copy

Lay out a graph and colorize it, then convert to a PNG image
$ dot [path/to/input.gv] | gvcolor | dot -T [png] > [path/to/output.png]
copy

Display help
$ gvcolor -?
copy

SYNOPSIS

gvcolor [-h] [-rresolution] [-ggamma] [-scalefactor] [-redamount] [-greenamount] [-blueamount] [-grayamount] [file ...]

PARAMETERS

-h
    Print usage information and exit

-rresolution
    Set resolution for image interpolation (default: 72)

-ggamma
    Set gamma correction value (default: 1.0)

-scalefactor
    Scale images by factor (default: 1.0)

-redamount
    Red tint intensity (0.0 to 1.0, default: 0.0)

-greenamount
    Green tint intensity (0.0 to 1.0, default: 0.0)

-blueamount
    Blue tint intensity (0.0 to 1.0, default: 0.0)

-grayamount
    Gray tint intensity (0.0 to 1.0, default: 1.0)

DESCRIPTION

gvcolor is a filter utility that reads PostScript documents from standard input or specified files and outputs a colorized version to stdout.

It achieves colorization by inserting custom PostScript code to remap black pixels into a tinted color, improving readability on color displays, monitors, or projectors.
Black-and-white documents often appear harsh or low-contrast on color screens; gvcolor adds subtle tints (red, green, blue, or gray) to soften this while preserving document fidelity.

Originally developed as a companion to the gv PostScript viewer (a ghostview replacement), it integrates seamlessly in pipelines like gvcolor file.ps | gv -.
Parameters control resolution for image interpolation, gamma correction for brightness, scaling, and tint intensities (0.0-1.0).

Ideal for technical docs, PDFs converted to PS, or monochrome plots, but not for final printing as tints may shift on printers.

CAVEATS

Output optimized for screen viewing with gv; colors may not print accurately. Modifies PS code—backup originals. Handles most PS but may fail on complex or encrypted files.

EXAMPLE USAGE

gvcolor -red 0.3 -blue 0.7 document.ps | gv -
Adds purple tint for better contrast.

cat file.ps | gvcolor -gray 0.8 -scale 1.2 | lpr
Scales and lightens for printing.

HISTORY

Part of the gv package (Ghostview successor) by Tim Theisen, released ~1993. Evolved for X11 PostScript viewing; maintained until ~2010s, now in distro archives like Debian.

SEE ALSO

gv(1), ghostscript(1), ps2pdf(1)

Copied to clipboard