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
|
\
.\" 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 "Pamdepth User Manual" 0 "19 December 2013" "netpbm documentation"
.SH NAME
pamdepth - change the depth (color resolution) in a Netpbm image
.UN synopsis
.SH SYNOPSIS
\fBpamdepth\fP \fInewmaxval\fP [\fInetpbmfile\fP]
.UN description
.SH DESCRIPTION
.PP
This program is part of
.BR "Netpbm" (1)\c
\&.
.PP
\fBpamdepth\fP reads a Netpbm image as input, changes its depth (color
resolution), and writes out the resulting Netpbm image. I.e. the output has a
different maxval from the input, but all the same colors (apart from rounding
error).
.PP
Reducing the depth results in some loss of information.
.PP
Here is an example of the effect at the image format level: Assume you
start with an image with maxval 100 and sample values of 50 and 100. You
tell \fBpamdepth\fP to change it to depth 150. The output has maxval
200 and sample values 75 and 150.
.PP
This program works on multi-image streams.
.PP
Be careful of off-by-one errors when choosing the new maxval. For
instance, if you want the color values to be five bits wide, use a
maxval of 31, not 32.
.PP
One important use of \fBpamdepth\fP is to convert a new format
2-byte-per-sample PNM file to the older 1-byte-per-sample format.
Before April 2000, essentially all raw (binary) format PNM files had a
maxval less than 256 and one byte per sample, and many programs may
rely on that. If you specify a \fInewmaxval\fP less than 256, the
resulting file should be readable by any program that worked with PNM
files before April 2000.
.UN seealso
.SH SEE ALSO
.BR "pnm" (5)\c
\&,
.BR "pam" (5)\c
\&,
.BR "pnmquant" (1)\c
\&,
.BR "ppmdither" (1)\c
\&
.BR "ppmbrighten" (1)\c
\&
.BR "pamfunc" (1)\c
\&
.UN history
.SH HISTORY
.PP
\fBpamdepth\fP was new in Netpbm 10.32 (February 2006). It replaced
\fBpnmdepth\fP, by Jef Poskanzer. \fBpamdepth\fP is backward compatible
with \fBpnmdepth\fP and adds the ability to process arbitrary PAM images
and the ability to process multi-image input streams. \fBpnmdepth\fP
handled only PNM images and ignored all but the first in any stream.
.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/pamdepth.html
.PP
|