summary refs log tree commit diff
path: root/pamdepth.html
blob: 56bbda07db5edd9784e7fe35a18b9d4c39f3724a (plain) (blame)
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
79
80
81
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pamdepth User Manual</title></head>
<body>
<h1>pamdepth</h1>
Updated: 19 December 2013
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>

pamdepth - change the depth (color resolution) in a Netpbm image

<h2 id="synopsis">SYNOPSIS</h2>

<b>pamdepth</b> <i>newmaxval</i> [<i>netpbmfile</i>]

<h2 id="description">DESCRIPTION</h2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><b>pamdepth</b> 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).

<p>Reducing the depth results in some loss of information.

<p>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 <b>pamdepth</b> to change it to depth 150.  The output has maxval
200 and sample values 75 and 150.

<p>This program works on multi-image streams.

<p>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.

<p>One important use of <b>pamdepth</b> 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 <i>newmaxval</i> less than 256, the
resulting file should be readable by any program that worked with PNM
files before April 2000.

<h2 id="options">OPTIONS</h2>

<p>There are no command line options defined specifically
for <b>pamdepth</b>, but it recognizes the options common to all
programs based on libnetpbm (See <a href="index.html#commonoptions">
Common Options</a>.)

<h2 id="seealso">SEE ALSO</h2>

<a href="pnm.html">pnm</a>,
<a href="pam.html">pam</a>,
<a href="pnmquant.html">pnmquant</a>,
<a href="ppmdither.html">ppmdither</a>
<a href="pambrighten.html">pambrighten</a>
<a href="pamfunc.html">pamfunc</a>

<h2 id="history">HISTORY</h2>

<p><b>pamdepth</b> was new in Netpbm 10.32 (February 2006).  It replaced
<b>pnmdepth</b>, by Jef Poskanzer.  <b>pamdepth</b> is backward compatible
with <b>pnmdepth</b> and adds the ability to process arbitrary PAM images
and the ability to process multi-image input streams.  <b>pnmdepth</b>
handled only PNM images and ignored all but the first in any stream.

<hr>
<h2 id="index">Table Of Contents</h2>
<ul>
<li><a href="#synopsis">SYNOPSIS</a>
<li><a href="#description">DESCRIPTION</a>
<li><a href="#options">OPTIONS</a>
<li><a href="#seealso">SEE ALSO</a>
<li><a href="#history">HISTORY</a>
</ul>
</body>
</html>