about summary refs log tree commit diff
path: root/ppmrough.html
blob: 4e2d3fb991563fa53400b41194980fca63b0f6f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Ppmrough User Manual</TITLE></HEAD>
<BODY>
<H1>ppmrough</H1>
Updated: 23 August 2002
<BR>
<A HREF="#index">Table Of Contents</A>

<H2>NAME</H2>
ppmrough - create PPM image of two colors with a ragged border between them

<H2 id="synopsis">SYNOPSIS</H2>

<B>ppmrough</B>

[<B>-left </B><I>pixels</I>]

[<B>-right </B><I>pixels</I>]

[<B>-top </B><I>pixels</I>]

[<B>-bottom </B><I>pixels</I>]

[<B>-width </B><I>pixels</I>]

[<B>-height </B><I>pixels</I>]

[<B>-bg </B><I>colorspec</I>]

[<B>-fg </B><I>colorspec</I>]

[<B>-var </B><I>pixels</I>]

[<B>-randomseed </B><I>seed</I>]

[<B>-verbose</B>]

<P>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.

<H2 id="description">DESCRIPTION</H2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><B>ppmrough</b> generates a PPM image of the specified width, height, and
colors.  <B>ppmrough</B> tiles the image into semi-rectangular regions
with a ragged borders between them.  It calculates the fluctuations 
with the <b>rand()</b> standard C library function.

<P><B>ppmrough</B> writes the PPM image to Standard Output.

<P>The maxval of the output image is 255 (You can change this with
<b>pamdepth</b>).

<P>Use the options <B>-left</B> or <B>-right</B>, respectively, to
make vertical borders, and <B>-top</B> or <B>-bottom</B>,
respectively, to generate horizontal borders inside the image.  Each of
these options needs an integer value <I>pixels</I> that determines the
average distance of the interior border to the related edge of the
image.  You may combine the <B>-left</B>, <B>-right</B>, <B>-top</B>,
and <B>-bottom</B> options to generate an image with more than one
border.  The algorithm ensures that you can concatenate two images
produced with the same (i.e. <B>-left</B>) value without dislocations.

<P>You specify the dimensions of the generated image with the
<B>-width</B> and <B>-height</B> options.

<P>Use the <B>-bg</B> and <B>-fg</B> options to set the background
(margin) color and the foreground (interior) color, respectively.  If
you don't specify any of the <B>-left</B>, <B>-right</B>, <B>-top</B>,
and <B>-bottom</B> options, all pixels are set to foreground color.
The defaults are white foreground and black background.

<P>Use the <B>-var</B> option to control the "raggedness" of
the border.  The less its value is the smoother the border is.  You
can initialize the pseudo-random generator with the <B>-init</B>
option.

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

<H2 id="options">OPTIONS</H2>

<DL COMPACT>
<DT><B>-left=</B><I>pixels</I>

<DD> Specifies the mean distance of the border from the left margin
(default: no border).

<DT><B>-right=</B><I>pixels</I>

<DD>Specifies the mean distance of the border from the right margin
(default: no border).

<DT><B>-top=</B><I>pixels</I>

<DD>Specifies the mean distance of the border from the top margin
(default: no border).

<DT><B>-bottom=</B><I>pixels</I>

<DD>Specifies the mean distance of the border from the bottom margin
(default: no border).

<DT><B>-width=</B><I>pixels</I>

<DD>Specifies the width of the image (default: 100).

<DT><B>-height=</B><I>pixels</I>

<DD>Specifies the height of the image (default: 100).

<DT><B>-bg=</B><I>colorspec</I>

<DD>Background color.  <i>colorspec</i> is as described for the
<a href="libppm.html#colorname">argument of the <b>ppm_parsecolor()</b>
library routine</a>.  Default is black.

<DT><B>-fg=</B><I>color</I>

<DD>Foreground color.  <i>colorspec</i> is as described for the
<a href="libppm.html#colorname">argument of the <b>ppm_parsecolor()</b>
library routine</a>.  Default is white.

<DT><B>-var=</B><I>pixels</I>

<DD> Specifies the variance of the ragged border (default: 10). Must
be a positive integer.  Set <I>pixels</I> to 1 to get a straight
border.

<DT><B>-randomseed=</B><I>seed</I>

<DD>Use this option to initialize the pseudo-random number generator
(the Standard C library <b>srand()</b> function) with <I>seed</I>.

<p>Before Netpbm 10.61 (December 2012), this is called <b>-init</b>,
and that still works.

<DT><B>-verbose</B>

<DD>Run <B>ppmrough</B> in verbose mode.  It reports all parameters on
Standard Error.

</DL>

<H2 id="seealso">SEE ALSO</H2>

<B><A HREF="ppmmake.html">ppmmake</A></B>,
<B><A HREF="pnmcat.html">pnmcat</A></B>,
<B><A HREF="ppmtopgm.html">ppmtopgm</A></B>,
<B><A HREF="ppm.html">ppm</A></B>,

<H2 id="history">HISTORY</H2>

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

<H2 id="author">AUTHOR</H2>

Copyright (C) 2002 by Eckard Specht.


<HR>
<H2 id="index">Table Of Contents</H2>
<UL>
<LI><A HREF="#synopsis">SYNOPSIS</A>
<LI><A HREF="#description">DESCRIPTION</A>
<LI><A HREF="#options">OPTIONS</A>
<LI><A HREF="#seealso">SEE ALSO</A>
<LI><A HREF="#author">AUTHOR</A>
</UL>
<HR>
</BODY>
</HTML>