| 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 "Pamdepth User Manual" 1 "26 August 2020" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
|
| 10 |
pamdepth - change the depth (color resolution) in a Netpbm image |
| 11 |
|
| 12 |
.UN synopsis |
| 13 |
.SH SYNOPSIS |
| 14 |
|
| 15 |
\fBpamdepth\fP \fInewmaxval\fP [\fInetpbmfile\fP] |
| 16 |
|
| 17 |
.UN description |
| 18 |
.SH DESCRIPTION |
| 19 |
.PP |
| 20 |
This program is part of |
| 21 |
.BR "Netpbm" (1)\c |
| 22 |
\&. |
| 23 |
.PP |
| 24 |
\fBpamdepth\fP reads a Netpbm image as input, changes its depth (color |
| 25 |
resolution), and writes out the resulting Netpbm image. I.e. the output has a |
| 26 |
different maxval from the input, but all the same colors (apart from rounding |
| 27 |
error). |
| 28 |
.PP |
| 29 |
Reducing the depth results in some loss of information. |
| 30 |
.PP |
| 31 |
Here is an example of the effect at the image format level: Assume you |
| 32 |
start with an image with maxval 100 and sample values of 50 and 100. You |
| 33 |
tell \fBpamdepth\fP to change it to depth 150. The output has maxval |
| 34 |
200 and sample values 75 and 150. |
| 35 |
.PP |
| 36 |
This program works on multi-image streams. |
| 37 |
.PP |
| 38 |
Be careful of off-by-one errors when choosing the new maxval. For |
| 39 |
instance, if you want the color values to be five bits wide, use a |
| 40 |
maxval of 31, not 32. |
| 41 |
.PP |
| 42 |
One important use of \fBpamdepth\fP is to convert a new format |
| 43 |
2-byte-per-sample PNM file to the older 1-byte-per-sample format. |
| 44 |
Before April 2000, essentially all raw (binary) format PNM files had a |
| 45 |
maxval less than 256 and one byte per sample, and many programs may |
| 46 |
rely on that. If you specify a \fInewmaxval\fP less than 256, the |
| 47 |
resulting file should be readable by any program that worked with PNM |
| 48 |
files before April 2000. |
| 49 |
|
| 50 |
.UN output_format |
| 51 |
.SS Output Format |
| 52 |
.PP |
| 53 |
The output format (PBM, etc.) and, in the case of PAM, tuple type, of the |
| 54 |
output is usually the same as the input. |
| 55 |
.PP |
| 56 |
However, changing the depth of a black and white image does not make sense, |
| 57 |
except to turn it into a grayscale image, so if the input is a black and white |
| 58 |
image, \fBpamdepth\fP makes the output grayscale. To be more precise, if the |
| 59 |
input is a PBM image, the output is PGM, and if the input is a PAM with tuple |
| 60 |
type BLACKANDWHITE or BLACKANDWHITE_ALPHA, the output is a PAM with tuple type |
| 61 |
GRAYSCALE or GRAYSCALE_ALPHA, respectively. |
| 62 |
.PP |
| 63 |
This conversion happens even if the new maxval is 1. |
| 64 |
.PP |
| 65 |
Before Netpbm 10.92 (September 2020), \fBpamdepth\fP failed if the input |
| 66 |
was PAM with a black and white tuple type and the new maxval was anything but |
| 67 |
1. But it always promoted PBM to PGM. |
| 68 |
|
| 69 |
|
| 70 |
.UN options |
| 71 |
.SH OPTIONS |
| 72 |
.PP |
| 73 |
There are no command line options defined specifically |
| 74 |
for \fBpamdepth\fP, but it recognizes the options common to all |
| 75 |
programs based on libnetpbm (See |
| 76 |
.UR index.html#commonoptions |
| 77 |
Common Options |
| 78 |
.UE |
| 79 |
\&.) |
| 80 |
|
| 81 |
.UN seealso |
| 82 |
.SH SEE ALSO |
| 83 |
.BR "pnm" (1)\c |
| 84 |
\&, |
| 85 |
.BR "pam" (1)\c |
| 86 |
\&, |
| 87 |
.BR "pnmquant" (1)\c |
| 88 |
\&, |
| 89 |
.BR "ppmdither" (1)\c |
| 90 |
\& |
| 91 |
.BR "pambrighten" (1)\c |
| 92 |
\& |
| 93 |
.BR "pamfunc" (1)\c |
| 94 |
\& |
| 95 |
|
| 96 |
.UN history |
| 97 |
.SH HISTORY |
| 98 |
.PP |
| 99 |
\fBpamdepth\fP was new in Netpbm 10.32 (February 2006). It replaced |
| 100 |
\fBpnmdepth\fP, by Jef Poskanzer. \fBpamdepth\fP is backward compatible |
| 101 |
with \fBpnmdepth\fP and adds the ability to process arbitrary PAM images |
| 102 |
and the ability to process multi-image input streams. \fBpnmdepth\fP |
| 103 |
handled only PNM images and ignored all but the first in any stream. |
| 104 |
.SH DOCUMENT SOURCE |
| 105 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 106 |
source. The master documentation is at |
| 107 |
.IP |
| 108 |
.B http://netpbm.sourceforge.net/doc/pamdepth.html |
| 109 |
.PP |