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 "Pamendian User Manual" 0 "16 March 2002" "netpbm documentation"
7
8.SH NAME
9
10pamendian - reverse endianness of a Netpbm image
11
12.UN synopsis
13.SH SYNOPSIS
14
15\fBpamendian\fP
16
17.UN description
18.SH DESCRIPTION
19.PP
20This program is part of
21.BR "Netpbm" (1)\c
22\&.
23.PP
24All Netpbm formats that have samples in pure binary format with multiple
25bytes are defined to have them in big endian (most significant byte first)
26order.  However, there exist variations on these formats, primarily developed
27before official multibyte Netpbm formats existed, that are identical to
28Netpbm formats in every respect except that samples are in little endian
29(least significant byte first) order.
30.PP
31\fBpamendian\fP reverses the byte order of the sample to convert
32between the two formats.  If the input is true PAM, PGM, or PPM, the
33output is the little endian variation on that format, and vice versa.
34.PP
35The X Window System viewer \fBxv\fP expects the little endian variation
36of PGM and PPM.
37.PP
38Programs that come with the Independent Jpeg Group's JPEG library
39are known to use the little endian variation of PGM and PPM.
40.PP
41The reason some programs use this variant is that at one time
42during Netpbm's
43.BR "dark age" (1)\c
44\&, there
45was a version of Netpbm around that used it.  But it was never
46formally specified.
47.PP
48This program takes input only on Standard Input.  Its output is
49always on Standard Output.
50.PP
51You should never have to use this program with images generated by
52programs in the Netpbm package or programs that use the Netpbm
53libraries.  If you do, that probably means something needs to be fixed
54in those programs.  The Netpbm converter for any graphics format that
55represents numbers in little endian form should properly reverse the
56bytes to create correct Netpbm output.
57.PP
58If you create a Netpbm image from a generic stream of samples,
59using \fBrawtopgm\fP or \fBrawtoppm\fP, use options on those
60programs to declare the endianness of your input, thus creating
61correct endianness in your PGM or PPM output.
62
63.UN seealso
64.SH SEE ALSO
65.BR "pamdepth" (1)\c
66\&,
67.BR "rawtopgm" (1)\c
68\&,
69.BR "rawtoppm" (1)\c
70\&,
71.BR "pnm" (5)\c
72\&
73.SH DOCUMENT SOURCE
74This manual page was generated by the Netpbm tool 'makeman' from HTML
75source.  The master documentation is at
76.IP
77.B http://netpbm.sourceforge.net/doc/pamendian.html
78.PP