Scroll to navigation

Ppmrough User Manual(0) Ppmrough User Manual(0)


ppmrough - create PPM image of a single color rectangle with ragged edges on a different color background



[-left pixels]

[-right pixels]

[-top pixels]

[-bottom pixels]

[-width pixels]

[-height pixels]

[-bg colorspec]

[-fg colorspec]

[-var pixels]

[-randomseed seed]


All options can be abbreviated to their shortest unique prefix. You may use two hyphens instead of one. You may separate an option name and its value with white space instead of an equals sign.


This program is part of Netpbm(1).

ppmrough generates a PPM image of the specified width and height.
The image consists of a rectangle of the specified foreground color
surrounded by borders of the specified size and background color, except
that the boundary between the foreground rectangle and the borders is
ragged. The ragged effect is random.

ppmrough writes the PPM image to Standard Output.

The maxval of the output image is 255 (You can change this with pamdepth).

Use the options -left or -right, respectively, to make vertical borders, and -top or -bottom, respectively, to generate horizontal borders inside the image. The value of each of these options is the minimum width of the border on that edge. Beyond that minimum, the width at any given location on that edge is random, varying along the edge in a fractal kind of way.

Use the -var option to control the "raggedness" of the border. The lower its value, the smoother the border is. You can initialize the pseudo-random generator with the -init option.

You could use ppmrough with ppmtopgm to create a PGM transparency mask and use it to roughen up the edges of another image.


In addition to the options common to all programs based on libnetpbm (most notably -quiet, see
Common Options
), ppmrough recognizes the following command line options:

This specifies the width of the image in pixels (default: 100).

This specifies the height of the image in pixels (default: 100).

This option causes the program to create a left, right, top, or bottom border, respectively, at least pixels pixels wide, varying randomly beyond that. You may specify any combination of these.

This is the background color, i.e. the color of the borders. colorspec is as described for the argument of the pnm_parsecolor() library routine . Default is black.

This specifies the foreground color, i.e. the color of the center of the mage -- everything but the borders. colorspec is as described for the argument of the pnm_parsecolor() library routine . Default is white.

This specifies how ragged the borders are -- how much and how quickly its width varies along the image edge. Its specific meaning is complex, but the larger it is, the more the border varies. Zero means it does not vary at all -- the edge of the foreground is straight.

This must be a nonnegative integer. The default is 10.

Use this option to initialize the pseudo-random number generator with seed.

You can use this to cause the program to produce repeatable output.

Before Netpbm 10.61 (December 2012), this is called -init, and that still works.

Run ppmrough in verbose mode. It reports all parameters on Standard Error.


ppmmake(1), pamcat(1), ppmtopgm(1), ppm(5),


This program was added to Netpbm in Release 10.9 (September 2002).


Copyright (C) 2002 by Eckard Specht.


This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at
20 August 2023 netpbm documentation