| 1 |
\ |
| 2 |
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |
| 3 |
.\" Do not hand-hack it! If you have bug fixes or improvements, please find |
| 4 |
.\" the corresponding HTML page on the Netpbm website, generate a patch |
| 5 |
.\" against that, and send it to the Netpbm maintainer. |
| 6 |
.TH "Pamtohdiff User Manual" 1 "15 April 2002" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
|
| 10 |
pamtohdiff - convert PAM image to horizontal difference image |
| 11 |
|
| 12 |
.UN synopsis |
| 13 |
.SH SYNOPSIS |
| 14 |
|
| 15 |
\fBpamtohdiff\fP |
| 16 |
[\fIpamfile\fP] |
| 17 |
[\fB-verbose\fP] |
| 18 |
|
| 19 |
.UN description |
| 20 |
.SH DESCRIPTION |
| 21 |
.PP |
| 22 |
This program is part of |
| 23 |
.BR "Netpbm" (1)\c |
| 24 |
\&. |
| 25 |
.PP |
| 26 |
\fBpamtohdiff\fP takes a PAM (or PNM) image as input and produces a |
| 27 |
horizontal difference image version of it as output. A horizontal |
| 28 |
difference image is one where the samples in each row indicate the |
| 29 |
difference between the sample value in the corresponding sample of the |
| 30 |
input image and the sample directly above it (in the previous row) in |
| 31 |
the input image. The horizontal difference image has the property |
| 32 |
that if a row of the original image is identical to the row above it |
| 33 |
over a long extent, the corresponding row in the horizontal difference |
| 34 |
image will contain all zeroes. That makes it compress better than the |
| 35 |
original image. |
| 36 |
.PP |
| 37 |
Because the horizontal difference samples can be positive or |
| 38 |
negative, but PAM samples are unsigned integers, the samples in the |
| 39 |
horizontal difference image PAM are defined to be the difference |
| 40 |
modulus the range of the input (maxval + 1). This doesn't lose any |
| 41 |
information, as it might seem, because: of the two differences that |
| 42 |
could result in the same \fBpamtohdiff\fP output value (e.g. if |
| 43 |
maxval is 99, +20 and -80 would both result in "20" in the output), |
| 44 |
only one is possible in context and the other would result, when |
| 45 |
reconstructing the original image, in a value less than 0 or greater |
| 46 |
than maxval. |
| 47 |
.PP |
| 48 |
Before the modulus operation, the values \fBpamtohdiff\fP |
| 49 |
computes are also biased by half the maxval. This is to make the |
| 50 |
results easier to inspect visually. Because of the bias, you can |
| 51 |
display the \fBpamtohdiff\fP output as if it were a PNM image. As |
| 52 |
long as none of your differences are more than half the maxval, large |
| 53 |
negative differences show up as dark spots, smaller negative |
| 54 |
differences are lighter, zero differences are medium intensity, and |
| 55 |
positive differences are light. If you want this to work even for |
| 56 |
images that have differences that exceed half the maxval, just use |
| 57 |
\fBppmdim 50\fP on the original image. To avoid losing information, |
| 58 |
though, do a \fBpamdepth\fP to double the maxval first. |
| 59 |
.PP |
| 60 |
Note that because of the transfer function just described, a |
| 61 |
difference of zero, which is most common, is represented by a PAM sample |
| 62 |
value in the output of one half the maxval. |
| 63 |
.PP |
| 64 |
The output PAM has a tuple type of "hdiff". |
| 65 |
.PP |
| 66 |
You can use \fBhdifftopam\fP to recover the original image from a |
| 67 |
horizontal difference image PAM. |
| 68 |
|
| 69 |
|
| 70 |
.UN options |
| 71 |
.SH OPTIONS |
| 72 |
.PP |
| 73 |
In addition to the options common to all programs based on libnetpbm |
| 74 |
(most notably \fB-quiet\fP, see |
| 75 |
.UR index.html#commonoptions |
| 76 |
Common Options |
| 77 |
.UE |
| 78 |
\&), \fBpamtohdiff\fP recognizes the following |
| 79 |
command line option: |
| 80 |
|
| 81 |
|
| 82 |
.TP |
| 83 |
\fB-verbose\fP |
| 84 |
Currently no effect. This may change in future versions. |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
.UN seealso |
| 91 |
.SH SEE ALSO |
| 92 |
.BR "hdifftopam" (1)\c |
| 93 |
\&, |
| 94 |
.BR "pamdepth" (1)\c |
| 95 |
\& |
| 96 |
|
| 97 |
.UN author |
| 98 |
.SH AUTHOR |
| 99 |
|
| 100 |
Bryan Henderson |
| 101 |
.SH DOCUMENT SOURCE |
| 102 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 103 |
source. The master documentation is at |
| 104 |
.IP |
| 105 |
.B http://netpbm.sourceforge.net/doc/pamtohdiff.html |
| 106 |
.PP |