LinuxCommandLibrary

ppmwheel

Rotate PPM image files

TLDR

Generate a color wheel of type Ppmcirc

$ ppmwheel [diameter] > [path/to/output.ppm]
copy

Generate a color wheel of type Hue-value
$ ppmwheel [[-huev|-huevalue]] [diameter] > [path/to/output.ppm]
copy

Generate a color wheel of type Hue-saturation
$ ppmwheel [[-hues|-huesaturation]] [diameter] > [path/to/output.ppm]
copy

SYNOPSIS

ppmwheel [-color|-grey] [-verbose] [-wheelgeometry widthxheight] [-slices n] [-inner fraction]

PARAMETERS

-color
    Produce color wheel (default).

-grey or -gray
    Produce grayscale wheel using NTSC brightness.

-verbose
    Print image info to stderr.

-wheelgeometry widthxheight
    Set wheel size; default 128x128.

-slices n
    Number of radial slices; default 24.

-inner fraction
    Inner circle radius as fraction of total; default 0.6.

DESCRIPTION

ppmwheel is a utility from the Netpbm graphics toolkit that creates a circular PPM (Portable Pixmap) image representing a color wheel.

This wheel arranges hues around the circumference, with saturation increasing from the center outward to the edge. The center is white, transitioning through desaturated colors to fully saturated hues on the rim. It's ideal for color palettes, selection tools, or test images in graphics applications.

By default, it produces a 128x128 color wheel with 24 slices. Users can customize size, slice count, inner radius fraction, or switch to grayscale (using NTSC brightness equivalents). Output is raw PPM to stdout, suitable for piping to viewers, converters like pnmtopng, or display tools.

Colors follow HSV model: constant value, varying hue and saturation. Useful for designers, developers testing color rendering, or generating reference images.

CAVEATS

Outputs raw PPM to stdout; redirect with > file.ppm. Options abbreviate per Netpbm conventions. Square geometry recommended.

EXAMPLES

ppmwheel | pnmtopng > wheel.png
ppmwheel -grey -wheelgeometry 256x256 -slices 36 > graywheel.ppm

COLOR MODEL

Uses HSV: hue varies by slice angle, saturation radial from inner (0) to outer (1), brightness fixed at 1.

HISTORY

Developed by Jef Poskanzer as part of original PBMPLUS (1988-1991); integrated into Netpbm project (1990s-present). Remains stable for legacy PPM workflows.

SEE ALSO

ppm(5), pbm(5), pgm(5), pnmtopng(1), ppmtogif(1)

Copied to clipboard