about summary refs log tree commit diff
path: root/pammixmulti.html
blob: c5854c32809309aeeeda8b7f79bd877090fd1548 (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
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
<html>
<head>
<title>Pammixmulti User Manual</title>
</head>
<body>
<h1>pammixmulti</h1>

Updated: 18 November 2018<br />
<a href="#index">Table Of Contents</a>
  

<h2 id="name">NAME</h2>
<p>pammixmulti - blend together multiple PAM images</p>


<h2 id="synopsis">SYNOPSIS</h2>
<p><b>pammixmulti</b>
  [<b>--blend</b>=average|random|mask]
  [<b>--maskfile</b>=<i>filename</i>]
  [<b>--stdev</b>=<i>number</i>]
  [<b>--randomseed</b> <i>integer</i>]
  <i>filename</i> ...

<p>Minimum unique abbreviation of an option is acceptable. You can use a
single hyphen instead of double hyphens to denote options. You can use white
space in place of the equals sign to separate an option name from its
value.</p>


<h2 id="description">DESCRIPTION</h2>
<p>This file is part of <a href="http://netpbm.sourceforge.net/doc/index.html">Netpbm</a>.</p>

<p><b>pammixmulti</b> mixes two or more images to produce a new image. The
program provides multiple ways to interpret "mix."


<h2 id="options">OPTIONS</h2>
<p><b>pammixmulti</b> accepts the following command-line options:</p>

<dl>
<dt><b>--blend</b>=average|random|mask</dt>
<dd>
<p>This option specifies how the input images should be mixed to produce the
output image.  With <b>--blend</b>=<code>average</code> (the default), each
pixel in the output is produced by averaging the corresponding pixels from all
the input images.  With <b>--blend</b>=<code>random</code>, each pixel in the
output is produced by selecting the corresponding pixel from one of the input
images, chosen at random on a per-pixel basis.  With
<b>--blend</b>=<code>mask</code>, each pixel in the output is produced by a
weighted average of the corresponding pixels from all the input images based
on the grayscale level of an additional mask image.</p>
</dd>

<dt><b>--maskfile</b>=<i>filename</i></dt>
<dd>
<p>In conjunction with <b>--blend</b>=<code>mask</code>, this option names a
grayscale mask file to control the blending of each pixel.  (If the file is
not grayscale, the first channel is treated as gray).  Where the mask file is
black, the first image is selected. Where the mask file is white, the last
image is selected.  Intermediate levels of gray select intermediate
images.</p>
</dd>

<dt><b>--stdev</b>=<i>number</i></dt>
<dd>
<p>When used with <b>--blend</b>=<code>mask</code>, this option controls how
smoothly the various input images are mixed to produce each output pixel.  For
example, consider running <b>pammixmulti</b> with three input images and a
mask image that uses gray levels from 0 to 255. Given <b>--stdev</b>=0.0, gray
levels 0-84 produce exclusively image 1; gray levels 85-170 produce
exclusively image 2; and gray levels 171-255 produce exclusively image 3.  If
the argument to <b>--stdev</b> is positive, images are blended according to a
normal distribution.  Hence, gray levels around 85 produce an output pixel
that includes roughly equal amounts of the corresponding pixel from images 1
and 2 but less of the corresponding pixel from image 3.  As <i>number</i>
tends towards the number of input images (going beyond that has diminishing
impact), the output tends to look more
like <b>--blend</b>=average. <i>number</i> defaults to 0.25.</p>
</dd>

<dt><b>--randomseed</b> <i>integer</i>

<dd>This is the seed for the random number generator used with
<b>--blend=random</b>

<p>Use this to ensure you get the same image on separate invocations.

</dl>

<h2 id="arguments">ARGUMENTS</h2>

<p>You supply the names of the files to mix as non-option arguments.</p>


<h2 id="examples">EXAMPLES</h2>

<p>Average a bunch of PPM images to produce a new PAM image:</p>
<pre><code>
    pammixmulti input*.ppm &gt;output.ppm
</code></pre>

<p>Mix these same images by taking each pixel from a randomly selected input
image:</p>

<pre><code>
    pammixmulti --blend=random input*.ppm &gt;output.ppm
</code></pre>

<p>Use a mask image to control the fading among input images on a
pixel-by-pixel basis:</p>

<pre><code>
    pammixmulti --blend=mask --maskfile=mask.pgm &gt;output.pam \
       one.pam two.pam three.pam four.pam
</code></pre>

<p>Do the same but with more abrupt transitions:</p>

<pre><code>
    pammixmulti --blend=mask --maskfile=mask.pgm --stdev=0.0 &gt;output.pam \
       one.pam two.pam three.pam four.pam
</code></pre>

<p>and now with more gradual transitions:</p>

<pre><code>
    pammixmulti --blend=mask --maskfile=mask.pgm --stdev=1.0 &gt;output.pam \
       one.pam two.pam three.pam four.pam
</code></pre>


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

<p><b>pammixmulti</b> was new in Netpbm 10.85 (December 2018).


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

<p>Copyright 2018 Scott Pakin, scott+pbm@pakin.org.</p>

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

<p><a href="pamcomp.html">pamcomp</a>,
<a href="ppmmix.html">ppmmix</a>,
<a href="pamarith.html">pamarith</a>,
<a href="pnm.html">pnm</a>,
<a href="pam.html">pam</a>


<h2 id="index">Table Of Contents</h2>

<ul>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#options">OPTIONS</a></li>
<li><a href="#arguments">ARGUMENTS</a></li>
<li><a href="#examples">EXAMPLES</a></li>
<li><a href="#history">HISTORY</a></li>
<li><a href="#author">AUTHOR</a></li>
<li><a href="#seealso">SEE ALSO</a></li>
</ul>

</body>
</html>