Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//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="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="ppmbrighten.html">ppmbrighten</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="#seealso">SEE ALSO</A>
<LI><A HREF="#history">HISTORY</A>
</UL>
</BODY>
</HTML>