\ .\" This man page was generated by the Netpbm tool 'makeman' from HTML source. .\" Do not hand-hack it! If you have bug fixes or improvements, please find .\" the corresponding HTML page on the Netpbm website, generate a patch .\" against that, and send it to the Netpbm maintainer. .TH "Pamtohdiff User Manual" 1 "15 April 2002" "netpbm documentation" .SH NAME pamtohdiff - convert PAM image to horizontal difference image .UN synopsis .SH SYNOPSIS \fBpamtohdiff\fP [\fIpamfile\fP] [\fB-verbose\fP] .UN description .SH DESCRIPTION .PP This program is part of .BR "Netpbm" (1)\c \&. .PP \fBpamtohdiff\fP takes a PAM (or PNM) image as input and produces a horizontal difference image version of it as output. A horizontal difference image is one where the samples in each row indicate the difference between the sample value in the corresponding sample of the input image and the sample directly above it (in the previous row) in the input image. The horizontal difference image has the property that if a row of the original image is identical to the row above it over a long extent, the corresponding row in the horizontal difference image will contain all zeroes. That makes it compress better than the original image. .PP Because the horizontal difference samples can be positive or negative, but PAM samples are unsigned integers, the samples in the horizontal difference image PAM are defined to be the difference modulus the range of the input (maxval + 1). This doesn't lose any information, as it might seem, because: of the two differences that could result in the same \fBpamtohdiff\fP output value (e.g. if maxval is 99, +20 and -80 would both result in "20" in the output), only one is possible in context and the other would result, when reconstructing the original image, in a value less than 0 or greater than maxval. .PP Before the modulus operation, the values \fBpamtohdiff\fP computes are also biased by half the maxval. This is to make the results easier to inspect visually. Because of the bias, you can display the \fBpamtohdiff\fP output as if it were a PNM image. As long as none of your differences are more than half the maxval, large negative differences show up as dark spots, smaller negative differences are lighter, zero differences are medium intensity, and positive differences are light. If you want this to work even for images that have differences that exceed half the maxval, just use \fBppmdim 50\fP on the original image. To avoid losing information, though, do a \fBpamdepth\fP to double the maxval first. .PP Note that because of the transfer function just described, a difference of zero, which is most common, is represented by a PAM sample value in the output of one half the maxval. .PP The output PAM has a tuple type of "hdiff". .PP You can use \fBhdifftopam\fP to recover the original image from a horizontal difference image PAM. .UN options .SH OPTIONS .PP In addition to the options common to all programs based on libnetpbm (most notably \fB-quiet\fP, see .UR index.html#commonoptions Common Options .UE \&), \fBpamtohdiff\fP recognizes the following command line option: .TP \fB-verbose\fP Currently no effect. This may change in future versions. .UN seealso .SH SEE ALSO .BR "hdifftopam" (1)\c \&, .BR "pamdepth" (1)\c \& .UN author .SH AUTHOR Bryan Henderson .SH DOCUMENT SOURCE This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at .IP .B http://netpbm.sourceforge.net/doc/pamtohdiff.html .PP