1Pamdepth User Manual(0) Pamdepth User Manual(0)
2
3
4
6 pamdepth - change the depth (color resolution) in a Netpbm image
7
8
10 pamdepth newmaxval [netpbmfile]
11
12
14 This program is part of Netpbm(1).
15
16 pamdepth reads a Netpbm image as input, changes its depth (color reso‐
17 lution), and writes out the resulting Netpbm image. I.e. the output
18 has a different maxval from the input, but all the same colors (apart
19 from rounding error).
20
21 Reducing the depth results in some loss of information.
22
23 Here is an example of the effect at the image format level: Assume you
24 start with an image with maxval 100 and sample values of 50 and 100.
25 You tell pamdepth to change it to depth 150. The output has maxval 200
26 and sample values 75 and 150.
27
28 This program works on multi-image streams.
29
30 Be careful of off-by-one errors when choosing the new maxval. For
31 instance, if you want the color values to be five bits wide, use a max‐
32 val of 31, not 32.
33
34 One important use of pamdepth is to convert a new format 2-byte-per-
35 sample PNM file to the older 1-byte-per-sample format. Before April
36 2000, essentially all raw (binary) format PNM files had a maxval less
37 than 256 and one byte per sample, and many programs may rely on that.
38 If you specify a newmaxval less than 256, the resulting file should be
39 readable by any program that worked with PNM files before April 2000.
40
41
43 pnm(1), pam(1), pnmquant(1), ppmdither(1) pambrighten(1) pamfunc(1)
44
45
47 pamdepth was new in Netpbm 10.32 (February 2006). It replaced
48 pnmdepth, by Jef Poskanzer. pamdepth is backward compatible with
49 pnmdepth and adds the ability to process arbitrary PAM images and the
50 ability to process multi-image input streams. pnmdepth handled only
51 PNM images and ignored all but the first in any stream.
52
54 This manual page was generated by the Netpbm tool 'makeman' from HTML
55 source. The master documentation is at
56
57 http://netpbm.sourceforge.net/doc/pamdepth.html
58
59netpbm documentation 19 December 2013 Pamdepth User Manual(0)