From 7dcdc8685cbddefc3a0a1e2fae65153fbe2dc8c5 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Fri, 18 Jul 2008 17:53:24 +0000 Subject: "miscellaneous update" git-svn-id: http://svn.code.sf.net/p/netpbm/code/userguide@682 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- libnetpbm_image.html | 5 +++-- pam.html | 2 +- pamfunc.html | 8 +++---- pgmminkowski.html | 1 + pngtopnm.html | 60 +++++++++++++++++++++++++++++----------------------- pnmtopng.html | 38 +++++++++++++++++++++++++-------- 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.

void pnm_freepamrown( -tuple *tuplenrow); +tuplen *tuplenrow); @@ -335,7 +335,8 @@ and computes some of the fields of the pam structure.

The following members of the *pamP structure must be set upon invocation to tell the function how and what to write. size, len, file, format, height, -width, depth, maxval, tuple_type. +width, depth, maxval. Furthermore, if +format is PAM_FORMAT, tuple_type must be set.

pnm_writepaminit() sets the plainformat and bytes_per_sample 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 TUPLTYPE or at the very end of the line. It does not include a newline. There must be something -other than white space after the TUPLETYPE token. +other than white space after the TUPLTYPE token.

If there are multiple TUPLTYPE 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. pamfunc applies a simple transfer function to each sample in the input to generate the corresponding sample in the output. The options determine what function. -

pamarith 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. +

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

OPTIONS

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.

SEE ALSO

pgmmorphconv +pbmminkowski pgm

AUTHORS

diff --git a/pngtopnm.html b/pngtopnm.html index 3c3d5c23..b944fedc 100644 --- a/pngtopnm.html +++ b/pngtopnm.html @@ -2,17 +2,15 @@ Pngtopnm User Manual

pngtopnm

-Updated: 24 March 2005 +Updated: 17 July 2008
Table Of Contents - 

NAME

pngtopnm - convert a PNG image into a PNM image -  -

SYNOPSIS

+

SYNOPSIS

pngtopnm [-verbose] @@ -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. -  -

DESCRIPTION

+

DESCRIPTION

This program is part of Netpbm. @@ -39,8 +36,7 @@ depends on the input file - if it's black & white, pngtopnm creates a PBM file. If it's grayscale, pngtopnm creates a PGM file. Otherwise, it creates a PPM file. -  -

OPTIONS

+

OPTIONS

-verbose @@ -88,11 +84,11 @@ white.

You cannot specify -background unless you also specify -mix. Before Netpbm 10.27 (March 2005), you could specify --background with -mix and it was just ignored. (This caused -a usability problem). +-background without -mix and it was just ignored. (This +caused a usability problem). -

-gamma= value +
-gamma=value
Converts the image to a new display-gamma value. If a gAMA chunk is present in the png-file, pngtopnm uses the specified @@ -108,6 +104,21 @@ light, your system is gamma-corrected, so convert with "-gamma 1.0". 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. +

One oddity to be aware of when using -gamma 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 pngtopnm 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 +pngtopnm considers pixels of all three shades to be transparent. + +

If this is not what you want, don't use gamma. Instead, +use pnmgamma on the output. + +

-text=file
Writes the tEXt and zTXt chunks to a file, in a format as @@ -120,8 +131,7 @@ text comments or annotations.
-  -

SEE ALSO

+

SEE ALSO

pnmtopng, ptot, @@ -131,8 +141,7 @@ text comments or annotations.

For information on the PNG format, see http://schaik.com/png. -  -

NOTE

+

NOTE

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. ptot to convert from PNG to TIFF, you'll get better results using that. -  -

LIMITATIONS

+

LIMITATIONS

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

AUTHORS

+

AUTHORS

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.  

Table Of Contents

diff --git a/pnmtopng.html b/pnmtopng.html index 876e029a..699ca32c 100644 --- a/pnmtopng.html +++ b/pnmtopng.html @@ -3,7 +3,7 @@ Pnmtopng User Manual

pnmtopng

-Updated: June 2002 +Updated: July 2008
Table Of Contents @@ -73,10 +73,29 @@ space in place of the equals sign to separate an option name from its value.

pnmtopng reads a PNM image as input and produces a PNG image as output. -

Color values in PNG files are either eight or sixteen bits wide, so -pnmtopng 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 pamdepth step is not necessary. +

Color component values in PNG files are either eight or sixteen +bits wide, so pnmtopng will automatically scale colors to have +a maxval of 255 or 65535. + +

For a grayscale image, pnmtopng 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 pamdepth to something with a large maxval that is a +power of two minus one (255 and 65535 are good choices) to minimize +the error. +

OPTIONS

@@ -119,8 +138,8 @@ with "unrecognized option," fall back to the old syntax.
-downscale
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. -
-interlace + this means loss of image data, pnmtopng does not do it by + default.
-interlace
Creates an interlaced PNG file (Adam7).
-alpha=filename @@ -152,8 +171,9 @@ equidistant, pnmtopng chooses one of them arbitrarily. "=", e.g.
+
                     -transparent =red
-
+
 

only the exact color you specify will be transparent. If that @@ -196,7 +216,7 @@ think it would, using -palette 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 -gamma .45. But sometimes +PPM or PGM image, you should specify -gamma=.45. 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 -- cgit 1.4.1