summary refs log tree commit diff
path: root/pamfind.html
blob: 8d97497f324366c9465a710f50991fddaa1309af (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pamfind User Manual</title></head>
<body>
<h1>pamfind</h1>
Updated: 13 March 2019
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>
pamfind - Print the locations of all tuples of a certain value in an image

<h2 id="synopsis">SYNOPSIS</h2>
<b>pamfind</b>
{
<b>-target=</b><i>sample0</i><b>,</b><i>sample1</i><b>,</b> ... |
<b>-color=</b><i>color</i>
}
[<b>-machine</b>]
[<i>imagefile</i>]

<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>pamfind</b> reads a Netpbm image (PNM or PAM) and prints a list of all
the locations (row and column) of the tuples that have a value you specify.
For example, you can list all the places that a visual image is red.

<p>You can specify the value in actual decimal sample values with
a <b>-target</b> option or as a color with <b>-color</b>.  If you
specify <b>-color</b>, the program fails if the input image does not have
depth 3.  If it has depth 3 but the tuples aren't actually colors, you get
results as if they are.

<p>To do the opposite, see what tuple is at a given location, use
<b>pamcut</b> and <b>pamtable</b>:

  <pre>
    <span style="font-family: monospace;">
      $ pamcut -left=5 -top=7 -width=1 -height=1 | pamtable
    </span>
  </pre>

<p><b>ppmcolormask</b> also finds all the tuples of a certain value, at least
in visual images, but instead of printing their coordinates, it generates a
mask image, which you can use to visualize where those tuples are or as input
to another program.


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

<p>In addition to the options common to all programs based on libnetpbm
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions">
Common Options</a>), <b>pamfind</b> recognizes the following
command line options:

<dl>

<dt><b>-target=</b><i>sample0</i><b>,</b><i>sample1</i><b>,</b> ... |

<dd>
This specifies the tuple value to find.  You specify the sample values in
order, and must specify the proper number of sample values for the depth of
the image (e.g. 3 if it is a color image).
  
<p>You must specify exactly one of <b>-target</b> and <b>-color</b>.

<dt><b>-color=</b><i>color</i>

<dd>
This is the color to find, assuming the image is a color visual image.    
<p><i>color</i> is as described for the <a
href="libnetpbm_image.html#colorname">argument of the <b>pnm_parsecolor()</b>
library routine</a>.

<p>You must specify exactly one of <b>-target</b> and <b>-color</b>.

<dt><b>-machine</b>

<dd>This makes the output more convenient for a machine to use, while
  less convenient for a human.  <b>pamfind</b> reports the same information
  as with no options.

<p>This option was new in Netpbm 10.87 (March 2020).

</dl>

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

<b><a href="pamdepth.html">pamdepth</a></b>,
<b><a href="pamgetcolor.html">pamgetcolor</a></b>,
<b><a href="ppmhist.html">ppmhist</a></b>,
<b><a href="ppmcolormask.html">ppmcolormask</a></b>,
<b><a href="pamcut.html">pamcut</a></b>,
<b><a href="pamtable.html">pamtable</a></b>,
<b><a href="pam.html">pam</a></b>

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

<p><b>pamfind</b> was added to Netpbm in Release 10.86 (March 2019).


<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="#history">HISTORY</a>
</ul>
</body>
</html>