summary refs log tree commit diff
path: root/pambayer.html
blob: ae83267b08a97ccea7d3ca3251b62220126c767b (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pambayer User Manual</title></head>
<body>
<h1>pambayer</h1>
Updated: 18 August 2005
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>
pambayer - interpret Bayer patterns

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

<b>pambayer</b>
<b>-type=</b>{<b>1</b>|<b>2</b>|<b>3</b>|<b>4</b>}
[<b>-nointerpolate</b>]
[<i>pamfile</i>]

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

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

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

<p><b>pambayer</b> reads a Bayer pattern in a 1-deep Netpbm image and
produces a color image in PAM RGB format as output.

<p>A Bayer pattern is what you get from the optical sensor in some
digital cameras.  Such a camera doesn't have a red, green, and blue
sensor in the exact same place for an individual pixel.  Instead, it
has red, green, and blue sensors laid out in a two dimensional array.
The pattern in which they are laid out is the Bayer pattern.  The
input to <b>pambayer</b> is one sample value for each of those
sensors, so some samples are red, some are green, and some are blue.

<p><b>pambayer</b> turns that into a regular visual image with one pixel
per sensor.  For the two components of each pixel that are missing in the
corresponding Bayer input, <b>pambayer</b> averages the sample values from
the adjacent pixels that do have that component.

<p>But you can have <b>pambayer</b> fill in black instead (see the
<b>-noninterpolate</b> option), which gives you a simpler representation of
what the camera saw, on which you might do further processing.  Such an image
still looks right, though considerably dimmer, if you stand far enough away
and let your eyes do the interpolation.

<p>The input image is a pseudo-PNM image (pseudo- because while the structure
is the same, the sample values have different meanings) or PAM image of
arbitrary tuple type.  <b>pambayer</b> looks at only the first plane of the
input.

<p>The output image is a PAM image of tuple type "RGB", i.e.
a standard color image.  You can convert this to PPM with
<a href="pamtopnm.html"><b>pamtopnm</b></a>.

<p>If you're interested in just one of the primary colors, use
<b>pamchannel</b> on the output of <b>pambayer</b> to extract it.


<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>pambayer</b> recognizes the following
command line options:

<dl compact>

<dt><b>-type=</b><i>n</i>

<dd>This tells which Bayer pattern the input is:

<dl>
<dt>1
<dd>GBG/RGR/GBG matrix
<dt>2
<dd>RGR/GBG/RGR matrix
<dt>3
<dd>BGB/GRG/BGB matrix
<dt>4
<dd>GRG/BGB/GRG matrix
</dl>

This option is mandatory.

<dt><b>-nointerpolate</b>

<dd>Each output pixel position corresponds to one position in the input
Bayer pattern, which means only one of the three color components is
supplied by the input.  For the other two, this option says to user zero.
Without it, <b>pambayer</b> instead interpolates from the adjacent pixels
that do have that color component.

<p>This option was new in Netpbm 10.49 (December 2009).

</dl>



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

<b><a href="cameratopam.html">cameratopam</a></b>
<b><a href="pam.html">pam</a></b>

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

<p><b>pambayer</b> was new in Netpbm 10.30 (October 2005).

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