about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2008-07-18 17:53:24 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2008-07-18 17:53:24 +0000
commit7dcdc8685cbddefc3a0a1e2fae65153fbe2dc8c5 (patch)
treeb7d6f0086abf660eb423f7aee0d6a328aa0800e2
parent035a8d09eba7be5cd21c24c52f7e51d9fcfa4ab9 (diff)
downloadnetpbm-mirror-7dcdc8685cbddefc3a0a1e2fae65153fbe2dc8c5.tar.gz
netpbm-mirror-7dcdc8685cbddefc3a0a1e2fae65153fbe2dc8c5.tar.xz
netpbm-mirror-7dcdc8685cbddefc3a0a1e2fae65153fbe2dc8c5.zip
"miscellaneous update"
git-svn-id: http://svn.code.sf.net/p/netpbm/code/userguide@682 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--libnetpbm_image.html5
-rw-r--r--pam.html2
-rw-r--r--pamfunc.html8
-rw-r--r--pgmminkowski.html1
-rw-r--r--pngtopnm.html60
-rw-r--r--pnmtopng.html38
6 files changed, 71 insertions, 43 deletions
diff --git a/libnetpbm_image.html b/libnetpbm_image.html
index 48e3ae8c..5e5aa541 100644
--- a/libnetpbm_image.html
+++ b/libnetpbm_image.html
@@ -181,7 +181,7 @@ format codes for the plain and raw subformats of each format.
 
 <P>
 <B>void pnm_freepamrown(</B>
-<B>tuple *</B><I>tuplenrow</I><B>);</B>
+<B>tuplen *</B><I>tuplenrow</I><B>);</B>
 
 
 
@@ -335,7 +335,8 @@ and computes some of the fields of the pam structure.
 <P>The following members of the <B>*</B><I>pamP</I> structure must be
 set upon invocation to tell the function how and what to write.
 <B>size</B>, <B>len</B>, <B>file</B>, <B>format</B>, <B>height</B>,
-<B>width</B>, <B>depth</B>, <B>maxval</B>, <B>tuple_type</B>.
+<B>width</B>, <B>depth</B>, <B>maxval</B>.  Furthermore, if
+<b>format</b> is <b>PAM_FORMAT</b>, <B>tuple_type</B> must be set.
 
 <P><B>pnm_writepaminit()</B> sets the <B>plainformat</B> and
 <B>bytes_per_sample</B> members based on the information supplied.
diff --git a/pam.html b/pam.html
index 3596fc7c..24b8407f 100644
--- a/pam.html
+++ b/pam.html
@@ -176,7 +176,7 @@ zero.  The rest of the line is part of the tuple type.  The rest of
 the line is not tokenized, but the tuple type does not include any
 white space immediately following <B>TUPLTYPE </B> or at the very end
 of the line.  It does not include a newline.  There must be something
-other than white space after the <b>TUPLETYPE</b> token.
+other than white space after the <b>TUPLTYPE</b> token.
 
 <p>If there are multiple <B>TUPLTYPE</B> header lines, the tuple type
 is the concatenation of the values from each of them, separated by a
diff --git a/pamfunc.html b/pamfunc.html
index ac61808e..42e33bbd 100644
--- a/pamfunc.html
+++ b/pamfunc.html
@@ -44,10 +44,10 @@ input.  <b>pamfunc</b> applies a simple transfer function to each
 sample in the input to generate the corresponding sample in the
 output.  The options determine what function.
 
-<P><b>pamarith</b> is the same thing, except only for PNM images, for
-binary functions -- it takes two PNM images as input and applies a
-specified simple arithmetic function (e.g. addition) on pairs of
-samples from the two to produce the single output image.
+<P><b>pamarith</b> is the same thing for binary functions -- it takes
+two images as input and applies a specified simple arithmetic function
+(e.g. addition) on pairs of samples from the two to produce the single
+output image.
 
 
 <H2 id="options">OPTIONS</H2>
diff --git a/pgmminkowski.html b/pgmminkowski.html
index cf6841fa..e110c970 100644
--- a/pgmminkowski.html
+++ b/pgmminkowski.html
@@ -77,6 +77,7 @@ lists the horizontal and vertical edge counts.
 <H2 id="seealso">SEE ALSO</H2>
 
 <B><A HREF="pgmmorphconv.html">pgmmorphconv</A></B>
+<B><A HREF="pbmminkowski.html">pbmminkowski</A></B>
 <B><A HREF="pgm.html">pgm</A></B>
 
 <H2 id="authors">AUTHORS</H2>
diff --git a/pngtopnm.html b/pngtopnm.html
index 3c3d5c23..b944fedc 100644
--- a/pngtopnm.html
+++ b/pngtopnm.html
@@ -2,17 +2,15 @@
 <HTML><HEAD><TITLE>Pngtopnm User Manual</TITLE></HEAD>
 <BODY>
 <H1>pngtopnm</H1>
-Updated: 24 March 2005
+Updated: 17 July 2008
 <BR>
 <A HREF="#index">Table Of Contents</A>
 
-<A NAME="lbAB">&nbsp;</A>
 <H2>NAME</H2>
 
 pngtopnm - convert a PNG image into a PNM image
 
-<A NAME="lbAC">&nbsp;</A>
-<H2>SYNOPSIS</H2>
+<H2 id="synopsis">SYNOPSIS</H2>
 
 <B>pngtopnm</B>
 [<b>-verbose</b>]
@@ -28,8 +26,7 @@ pngtopnm - convert a PNG image into a PNM image
 hyphens instead of single hyphen to denote options.  You may use white
 space in place of the equals sign to separate an option name from its value.
 
-<A NAME="lbAD">&nbsp;</A>
-<H2>DESCRIPTION</H2>
+<H2 id="description">DESCRIPTION</H2>
 
 <p>This program is part of <a href="index.html">Netpbm</a>.
 
@@ -39,8 +36,7 @@ depends on the input file - if it's black &amp; white, <b>pngtopnm</b>
 creates a PBM file.  If it's grayscale, <b>pngtopnm</b> creates a PGM
 file.  Otherwise, it creates a PPM file.
 
-<A NAME="lbAE">&nbsp;</A>
-<H2>OPTIONS</H2>
+<H2 id="options">OPTIONS</H2>
 
 <DL COMPACT>
 <DT><B>-verbose</B>
@@ -88,11 +84,11 @@ white.
 
 <p>You cannot specify <b>-background</b> unless you also specify
 <b>-mix</b>.  Before Netpbm 10.27 (March 2005), you could specify
-<b>-background</b> with <b>-mix</b> and it was just ignored.  (This caused
-a usability problem).
+<b>-background</b> without <b>-mix</b> and it was just ignored.  (This
+caused a usability problem).
 
 
-<DT><B>-gamma=</b> <i>value</i>
+<DT><B>-gamma=</b><i>value</i>
 
 <DD>Converts the image to a new display-gamma value.  If a gAMA chunk
 is present in the <I>png-file</I>, <b>pngtopnm</b> uses the specified
@@ -108,6 +104,21 @@ light, your system is gamma-corrected, so convert with &quot;-gamma 1.0&quot;.
 When no gAMA chunk is present or the image-gamma is 1.0, use 2.2 to make the 
 picture lighter and 0.45 to make the picture darker.
 
+<p>One oddity to be aware of when using <b>-gamma</b> on an image with
+transparency: The PNG image specifies that a certain color is
+transparent, i.e. every pixel in the image of that color is
+transparent.  But <b>pngtopnm</b> interprets this as applying to the
+gamma-corrected space, and there may be less precision in that space
+than in the original, which means multiple uncorrected colors map to
+the same corrected color.  So imagine that the image contains 3 shades
+of white and specifies that one of them is transparent.  After gamma
+correction, those three shades are indistinguishable, so
+<b>pngtopnm</b> considers pixels of all three shades to be transparent.
+
+<p>If this is not what you want, don't use <b>gamma</b>.  Instead,
+use <b>pnmgamma</b> on the output.
+
+
 <DT><B>-text=</b><i>file</i>
 
 <DD>Writes the tEXt and zTXt chunks to a file, in a format as
@@ -120,8 +131,7 @@ text comments or annotations.
 
 </DL>
 
-<A NAME="lbAF">&nbsp;</A>
-<H2>SEE ALSO</H2>
+<H2 id="seealso">SEE ALSO</H2>
 
 <A HREF="pnmtopng.html">pnmtopng</A>,
 <b>ptot</b>,
@@ -131,8 +141,7 @@ text comments or annotations.
 <p>For information on the PNG format, see <a
 href="http://schaik.com/png">http://schaik.com/png</a>.
 
-<A NAME="lbAG">&nbsp;</A>
-<H2>NOTE</H2>
+<H2 id="note">NOTE</H2>
 
 <p>A PNG image contains a lot of information that can't be represented in 
 Netpbm formats.  Therefore, you lose information when you convert to 
@@ -140,8 +149,7 @@ another format with "pngtopnm | pnmtoxxx".  If there is a specialized
 converter that converts directly to the other format, e.g. <b>ptot</b>
 to convert from PNG to TIFF, you'll get better results using that.
 
-<A NAME="lbAH">&nbsp;</A>
-<H2>LIMITATIONS</H2>
+<H2 id="limitations">LIMITATIONS</H2>
 
 There could be an option to read the comment text from pnm comments instead
 of a separate file.
@@ -150,8 +158,7 @@ of a separate file.
 As with any Netpbm program, speed always takes a back seat to quick
 present and future development.
 
-<A NAME="lbAI">&nbsp;</A>
-<H2>AUTHORS</H2>
+<H2 id="authors">AUTHORS</H2>
 
 Copyright (C) 1995-1997 by Alexander Lehmann and Willem van Schaik.
 
@@ -159,14 +166,13 @@ Copyright (C) 1995-1997 by Alexander Lehmann and Willem van Schaik.
 <A NAME="index">&nbsp;</A>
 <H2>Table Of Contents</H2>
 <UL>
-<LI><A HREF="#lbAB">NAME</A>
-<LI><A HREF="#lbAC">SYNOPSIS</A>
-<LI><A HREF="#lbAD">DESCRIPTION</A>
-<LI><A HREF="#lbAE">OPTIONS</A>
-<LI><A HREF="#lbAF">SEE ALSO</A>
-<LI><A HREF="#lbAG">NOTE</A>
-<LI><A HREF="#lbAH">LIMITATIONS</A>
-<LI><A HREF="#lbAI">AUTHORS</A>
+<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="#note">NOTE</A>
+<LI><A HREF="#limitations">LIMITATIONS</A>
+<LI><A HREF="#authors">AUTHORS</A>
 </UL>
 </BODY>
 </HTML>
diff --git a/pnmtopng.html b/pnmtopng.html
index 876e029a..699ca32c 100644
--- a/pnmtopng.html
+++ b/pnmtopng.html
@@ -3,7 +3,7 @@
 <HEAD><TITLE>Pnmtopng User Manual</TITLE></HEAD>
 <BODY>
 <H1>pnmtopng</H1>
-Updated: June 2002
+Updated: July 2008
 <BR>
 <A HREF="#index">Table Of Contents</A>
 
@@ -73,10 +73,29 @@ space in place of the equals sign to separate an option name from its value.
 <p><b>pnmtopng</b> reads a PNM image as input and produces a PNG image as
 output.
 
-<P>Color values in PNG files are either eight or sixteen bits wide, so
-<I>pnmtopng</I> will automatically scale colors to have a maxval of
-255 or 65535.  Grayscale files will be produced with bit depths 1, 2,
-4, 8 or 16.  An extra <B>pamdepth</B> step is not necessary.
+<P>Color component values in PNG files are either eight or sixteen
+bits wide, so <b>pnmtopng</b> will automatically scale colors to have
+a maxval of 255 or 65535.
+
+<p>For a grayscale image, <b>pnmtopng</b> produces a PNG bit depth 1,
+2, 4, 8 or 16.  When the input image has a small maxval, the output
+PNG image has a correspondingly small bit depth.  But in mapping the
+PNM maxval to the PNG maxval (which is by definition the maximum value
+that can be represented in the number of bits), a fair amount of
+distortion happens with these low maxvals.  For example, with a PNM
+maxval of 5 and a PNG maxval of 7, the input sample 2 becomes the
+output sample 3.  The input brightness is 2/5 = .40, while the output
+brightness is 3/7 = .43.  Note that this is not a problem if you view
+the maxval as a precision, because in .4 and .43 are identical within
+the precision implied by maxval 5.  Indeed, if you convert this PNG
+back to a maxval 5 PGM, the pixel's value will again be 2, exactly as
+it was originally.  But if you need precisely the same colors in the
+output PNG as in the input PNM, make sure your input PNM has a maxval
+which is a power of two minus one.  If you can't do that, then convert
+it with <b>pamdepth</b> to something with a large maxval that is a
+power of two minus one (255 and 65535 are good choices) to minimize
+the error.
+
 
 <H2 id="options">OPTIONS</H2>
 
@@ -119,8 +138,8 @@ with &quot;unrecognized option,&quot; fall back to the old syntax.
 <DT><B>-downscale</B>
 <DD>
      Enables scaling of maxvalues of more then 65535 to 16 bit. Since
-     this means loss of image data, the step is not performed by default.
-<DT><B>-interlace</B>
+     this means loss of image data, <b>pnmtopng</b> does not do it by
+     default.  <DT><B>-interlace</B>
 <DD>
      Creates an interlaced PNG file (Adam7).
 <DT><B>-alpha=</b><i>filename</i>
@@ -152,8 +171,9 @@ equidistant, <B>pnmtopng</B> chooses one of them arbitrarily.
 &quot;=&quot;, e.g.
 
 <pre>
+<kbd>
                     -transparent =red
-
+</kbd>
 </pre>
 
 <P> only the exact color you specify will be transparent.  If that
@@ -196,7 +216,7 @@ think it would, using <b>-palette</b> in this case wouldn't even save
 describe how the color values in the PNG must be interpreted.  Without
 the gAMA chunk, whatever interprets the PNG must get this information
 separately (or just assume something standard).  If your input is a true
-PPM or PGM image, you should specify <b>-gamma .45</b>.  But sometimes 
+PPM or PGM image, you should specify <b>-gamma=.45</b>.  But sometimes 
 people generate images which are ostensibly PPM except the image uses a 
 different gamma transfer function than the one specified for PPM.  A common
 case of this is when the image is created by simple hardware that doesn't