1Pamtohdiff User Manual(0)                            Pamtohdiff User Manual(0)
2
3
4

NAME

6       pamtohdiff - convert PAM image to horizontal difference image
7
8

SYNOPSIS

10       pamtohdiff [pamfile] [-verbose]
11
12

DESCRIPTION

14       This program is part of Netpbm(1).
15
16       pamtohdiff  takes a PAM (or PNM) image as input and produces a horizon‐
17       tal difference image version of it as output.  A horizontal  difference
18       image  is  one  where  the  samples in each row indicate the difference
19       between the sample value in the corresponding sample of the input image
20       and  the  sample  directly  above it (in the previous row) in the input
21       image.  The horizontal difference image has the property that if a  row
22       of  the  original  image  is  identical to the row above it over a long
23       extent, the corresponding row in the horizontal difference  image  will
24       contain  all  zeroes.   That makes it compress better than the original
25       image.
26
27       Because the horizontal difference samples can be positive or  negative,
28       but  PAM  samples  are unsigned integers, the samples in the horizontal
29       difference image PAM are defined to be the difference modulus the range
30       of  the  input  (maxval + 1).  This doesn't lose any information, as it
31       might seem, because: of the two differences that could  result  in  the
32       same  pamtohdiff  output value (e.g. if maxval is 99, +20 and -80 would
33       both result in "20" in the output), only one is possible in context and
34       the  other  would  result, when reconstructing the original image, in a
35       value less than 0 or greater than maxval.
36
37       Before the modulus operation, the values pamtohdiff computes  are  also
38       biased  by  half  the  maxval.   This  is to make the results easier to
39       inspect visually.  Because of the bias, you can display the  pamtohdiff
40       output  as if it were a PNM image.  As long as none of your differences
41       are more than half the maxval, large negative differences  show  up  as
42       dark  spots, smaller negative differences are lighter, zero differences
43       are medium intensity, and positive differences are light.  If you  want
44       this to work even for images that have differences that exceed half the
45       maxval, just use ppmdim 50 on the  original  image.   To  avoid  losing
46       information, though, do a pamdepth to double the maxval first.
47
48       Note that because of the transfer function just described, a difference
49       of zero, which is most common, is represented by a PAM sample value  in
50       the output of one half the maxval.
51
52       The output PAM has a tuple type of "hdiff".
53
54       You  can use hdifftopam to recover the original image from a horizontal
55       difference image PAM.
56
57
58

OPTIONS

60       In addition to the options common to all programs  based  on  libnetpbm
61       (most notably -quiet, see
62        Common Options ⟨index.html#commonoptions⟩ ), pamtohdiff recognizes the
63       following command line option:
64
65
66
67       -verbose
68              Currently no effect.  This may change in future versions.
69
70
71
72
73
74

SEE ALSO

76       hdifftopam(1), pamdepth(1)
77
78

AUTHOR

80       Bryan Henderson
81

DOCUMENT SOURCE

83       This manual page was generated by the Netpbm tool 'makeman'  from  HTML
84       source.  The master documentation is at
85
86              http://netpbm.sourceforge.net/doc/pamtohdiff.html
87
88netpbm documentation             15 April 2002       Pamtohdiff User Manual(0)
Impressum