\ .\" 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) . .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) , .BR pam (5) , .BR pnmquant (1) , .BR ppmdither (1) .BR ppmbrighten (1) .BR pamfunc (1) .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.