| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN"> |
| 2 |
<html><head><title>Pamgetcolor User Manual</title></head> |
| 3 |
<body> |
| 4 |
<h1>pamgetcolor</h1> |
| 5 |
Updated: 18 May 2018 |
| 6 |
<br> |
| 7 |
<a href="#index">Table Of Contents</a> |
| 8 |
|
| 9 |
<h2>NAME</h2> |
| 10 |
pamgetcolor - display the average colors from specified regions in an image. |
| 11 |
|
| 12 |
<h2 id="synopsis">SYNOPSIS</h2> |
| 13 |
|
| 14 |
<b>pamgetcolor</b> |
| 15 |
[<b>-format</b> <i>format</i>] |
| 16 |
[<b>-radius</b> <i>radius</i>] |
| 17 |
[<b>-linear</b>] |
| 18 |
[<b>-infile</b> <i>pamfile</i>] |
| 19 |
<i>region1</i> [<i>region2</i> ...] |
| 20 |
|
| 21 |
<h2 id="description">DESCRIPTION</h2> |
| 22 |
|
| 23 |
<p>This program is part of <a href="index.html">Netpbm</a>. |
| 24 |
|
| 25 |
<p><b>pamgetcolor</b> prints the average colors of a set of circular |
| 26 |
regions in the input image. |
| 27 |
|
| 28 |
<p>You specify a region as a positional argument of the form |
| 29 |
<i>column</i>,<i>row</i>[:<i>label</i>], where <i>column</i> and <i>row</i> |
| 30 |
are the coordinates of the center of the circle (first row of pixels is row 0; |
| 31 |
leftmost column of pixels is column 0), and <i>label</i> an optional label |
| 32 |
that <b>pamgetcolor</b> shall display to identify that region in its output. |
| 33 |
All regions have he same radius, specified by the <b>-radius</b> option. The |
| 34 |
region centers must lie within the image, but part of a region may fall |
| 35 |
outside the image; <b>pamgetcolor</b> considers only the part that is within |
| 36 |
the image in calculations. |
| 37 |
|
| 38 |
|
| 39 |
<h2 id="examples">EXAMPLES</h2> |
| 40 |
|
| 41 |
To read the color of the pixel at location (10,14) in the default |
| 42 |
format: |
| 43 |
|
| 44 |
<pre> |
| 45 |
<kbd> |
| 46 |
pamgetcolor 10,14 -infile test.ppm |
| 47 |
</kbd> |
| 48 |
</pre> |
| 49 |
|
| 50 |
<p>To read the colors of three pixels in the default format, assigning a |
| 51 |
label to each pixel: |
| 52 |
|
| 53 |
<pre> |
| 54 |
<kbd> |
| 55 |
pamgetcolor 10,10:topleft 100,100:middle 200,200:bottomright -infile test.ppm |
| 56 |
</kbd> |
| 57 |
</pre> |
| 58 |
|
| 59 |
<p>To read with 16-bit precision the average color in the circle with a radius |
| 60 |
of four pixels and the center at (100,100): |
| 61 |
|
| 62 |
<pre> |
| 63 |
<kbd> |
| 64 |
pamgetcolor -format int:65535 -radius 4 100,100 -infile test.ppm |
| 65 |
</kbd> |
| 66 |
</pre> |
| 67 |
|
| 68 |
|
| 69 |
<h2 id="options">OPTIONS</h2> |
| 70 |
|
| 71 |
<p>In addition to the options common to all programs based on libnetpbm |
| 72 |
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions"> |
| 73 |
Common Options</a>), <b>pamgetcolor</b> recognizes the following |
| 74 |
command line options: |
| 75 |
|
| 76 |
<dl> |
| 77 |
|
| 78 |
<dt><b>-format</b> |
| 79 |
<dd>This specifies the format in which to output the colors. The output is |
| 80 |
always a <a href="libppm.html#colorname">Netpbm color specification</a>; this |
| 81 |
format tells which of the various specifications for the same color the |
| 82 |
program uses. |
| 83 |
<p> |
| 84 |
This argument is of the form <i>formatId</i>[:<i>param</i>], where |
| 85 |
<i>formatId</i> specifies the format and <i>param</i> is a positive |
| 86 |
integer parameter that, depending on <i>formatId</i>, indicates |
| 87 |
either precision or normalization. The following values are possible for |
| 88 |
<i>formatId</i>: |
| 89 |
<dl> |
| 90 |
<dt>int |
| 91 |
<dd>Samples are decimal integers normalized to the maxval specified by |
| 92 |
<i>param</i>. Example: <b>rgb-255:255/128/64</b> |
| 93 |
This format is the default, with a maxval of 255. |
| 94 |
<dt>norm |
| 95 |
<dd>Samples are floating point numbers normalized to unity. E.g. |
| 96 |
<b>rgbi:1.0/0.5/.25</b> |
| 97 |
<i>param</i> specifies precision as the number of digits in the |
| 98 |
fractional part. |
| 99 |
<dt>x11 |
| 100 |
<dd>Samples are hexadecimal numbers with <i>param</i> digits, |
| 101 |
e.g. <b>rgb:01/ff/8000</b> |
| 102 |
</dl> |
| 103 |
|
| 104 |
<dt><b>-radius</b> |
| 105 |
<dd>sets the radius of the regions. |
| 106 |
A value of zero causes <b>pamgetcolor</b> to measure a single pixel and |
| 107 |
is the default. |
| 108 |
|
| 109 |
<dt><b>-infile</b> |
| 110 |
<dd>This specifies the Netpbm file to analyze. |
| 111 |
|
| 112 |
<p>If you don't specify this option, <b>pamgetcolor</b> reads the image from |
| 113 |
Standard Input. |
| 114 |
|
| 115 |
<dt><b>-linear</b> |
| 116 |
<dd>This tells <b>pamgetcolor</b> to work with the intensity-linear variation |
| 117 |
of Netpbm images where the samples are proportional to light intensity rather |
| 118 |
than to brightness, as in true (gamma-adjusted) Netpbm formats. |
| 119 |
|
| 120 |
</dl> |
| 121 |
|
| 122 |
<h2 id="seealso">SEE ALSO</h2> |
| 123 |
|
| 124 |
<p><b><a href="pnmcolormap.html">pnmcolormap</a></b>, |
| 125 |
|
| 126 |
|
| 127 |
<h2 id="author">AUTHOR</h2> |
| 128 |
|
| 129 |
<p>This program was first submitted by Anton Shepelev |
| 130 |
(<a href="mailto:[email protected]">[email protected]</a>). |
| 131 |
|
| 132 |
<h2 id="history">HISTORY</h2> |
| 133 |
|
| 134 |
<p>This program was new in Netpbm 10.83 (June 2018). |
| 135 |
|
| 136 |
<h2 id="index">Table Of Contents</h2> |
| 137 |
<ul> |
| 138 |
<li><a href="#synopsis">SYNOPSIS</a> |
| 139 |
<li><a href="#description">DESCRIPTION</a> |
| 140 |
<li><a href="#examples">EXAMPLES</a> |
| 141 |
<li><a href="#options">OPTIONS</a> |
| 142 |
<li><a href="#seealso">SEE ALSO</a> |
| 143 |
<li><a href="#author">AUTHOR</a> |
| 144 |
<li><a href="#history">HISTORY</a> |
| 145 |
</ul> |
| 146 |
|
| 147 |
|
| 148 |
</body></html> |