man > pgmramp(1)

TLDR: pgmramp (tldr-pages)

Generate a greyscale map.

  • Generate a left-to-right greyscale map
    pgmramp -lr > {{path/to/output.pgm}}
  • Generate a top-to-bottom greyscale map
    pgmramp -tb > {{path/to/output.pgm}}
  • Generate a rectangular greyscale map
    pgmramp -rectangle > {{path/to/output.pgm}}
  • Generate an elliptical greyscale map
    pgmramp -ellipse {{path/to/image.pgm}} > {{path/to/output.pgm}}
  • Generate a greyscale map from the top-left corner to the bottom-right corner
    pgmramp -diagonal {{path/to/image.pgm}} > {{path/to/output.pgm}}
Pgmramp User Manual(1)                 General Commands Manual                Pgmramp User Manual(1)

NAME
       pgmramp - generate a grayscale ramp


SYNOPSIS
       pgmramp {-lr|-tb|-rectangle|-ellipse|-diagonal} [-maxval=maxval] width height

       All  options can be abbreviated to their shortest unique prefix.  You may use two hyphens in‐
       stead of one to designate an option.  You may use either white space or an  equals  sign  be‐
       tween an option name and its value.


DESCRIPTION
       This program is part of Netpbm(1).

       Generates  a graymap of the specified size containing a black-to-white ramp.  These ramps are
       useful for multiplying with other images, using pamarith.

       The ramp is linear in brightness, not intensity.  I.e. the gamma-corrected sample  values  in
       the PGM rise linearly with distance from the corner of the image.  If you want a ramp that is
       linear in light intensity, use pnmgamma with pgmramp.

       Options  let you choose the shape of the ramp (left to right, inside out, etc.).  You can use
       pamflip to get more shapes.  For example, the -lr option gives you a left to right ramp and

           $ pgmramp -lr 100 100 | pamflip -lr


       gives you a right to left ramp.

       To generate a simple ramp of all the values from 0 to maxval, and not necessarily  a  graphic
       image, use pamseq(1).

       ppmrainbow  does  something similar to what pgmramp does, but for color.  The image fades be‐
       tween two colors of your choice.



OPTIONS
       In addition to the options common to all programs based on libnetpbm  (most  notably  -quiet,
       see ]8;;index.html#commonoptions\ Common Options]8;;\ ), pgmramp recognizes the following command line options:

       You must specify exactly one of the ramp type options.



       -lr    A left to right ramp.  Black on the left; white on the right.


       -tb    A top to bottom ramp.  Black on top; white on the bottom.


       -rectangle
              An outside-in rectangular ramp.  It is black around the edges and white in the center.


       -ellipse
              An outside-in elliptical ramp.  It is black around the edge and white in the center.


       -diagonal
              A  ramp  from top left corner diagonally down to bottom right.  Black at the top left;
              white at the bottom right.

              This option was new in Netpbm 10.66 (March 2014).


       -maxval=maxval
                   The maxval for the generated image.  Default is 255.

                   This option was new in Netpbm 10.1 (June 2002).  Before that, the maxval
                   is always 255.





SEE ALSO
       pamflip(1), pamarith(1), pnmgamma(1), pamseq(1), ppmrainbow(1), pamgradient(1), pgm(1)



AUTHOR
       Copyright (C) 1989 by Jef Poskanzer.

DOCUMENT SOURCE
       This manual page was generated by the Netpbm tool 'makeman' from  HTML  source.   The  master
       documentation is at

              http://netpbm.sourceforge.net/doc/pgmramp.html

netpbm documentation                      15 February 2014                    Pgmramp User Manual(1)
pgmramp(1)
NAME SYNOPSIS DESCRIPTION OPTIONS
-lr A left to right ramp. Black on the left; white on the right. -tb A top to bottom ramp. Black on top; white on the bottom. -rectangle -ellipse -diagonal -maxval=maxval
SEE ALSO AUTHOR DOCUMENT SOURCE

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-04 20:14 @216.73.216.243
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^