diff options
Diffstat (limited to 'pnmnorm.html')
-rw-r--r-- | pnmnorm.html | 178 |
1 files changed, 103 insertions, 75 deletions
diff --git a/pnmnorm.html b/pnmnorm.html index 17af3f4c..566964b1 100644 --- a/pnmnorm.html +++ b/pnmnorm.html @@ -1,22 +1,22 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> -<HTML><HEAD><TITLE>Pnmnorm User Manual</TITLE></HEAD> -<BODY> -<H1>pnmnorm</H1> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN"> +<html><head><title>Pnmnorm User Manual</title></head> +<body> +<h1>pnmnorm</h1> Updated: 19 December 2014 -<BR> -<A HREF="#index">Table Of Contents</A> +<br> +<a href="#index">Table Of Contents</a> -<H2>NAME</H2> +<h2>NAME</h2> pnmnorm - normalize the contrast in a Netpbm image -<H2 id="synopsis">SYNOPSIS</H2> +<h2 id="synopsis">SYNOPSIS</h2> -<B>pnmnorm</B> +<b>pnmnorm</b> -[<B>-bpercent=</B><I>percent</I> | <B>-bvalue=</B><I>N</I> | <b>-bsingle</b>] +[<b>-bpercent=</b><i>percent</i> | <b>-bvalue=</b><i>N</i> | <b>-bsingle</b>] -[<B>-wpercent=</B><I>percent</I> | <B>-wvalue=</B><I>N</I> | <b>-wsingle</b>] +[<b>-wpercent=</b><i>percent</i> | <b>-wvalue=</b><i>N</i> | <b>-wsingle</b>] [<b>-midvalue=</b><i>N</i>] @@ -24,19 +24,19 @@ pnmnorm - normalize the contrast in a Netpbm image [<b>-maxexpand=</b><i>percent</i>] -[<B>-keephues</B>] +[<b>-keephues</b>] -[<B>-luminosity</B> | <B>-colorvalue</B> | <B>-saturation</B>] +[<b>-luminosity</b> | <b>-colorvalue</b> | <b>-saturation</b>] -[<I>ppmfile</I>] +[<i>ppmfile</i>] -<P>All options can be abbreviated to their shortest unique prefix. +<p>All options can be abbreviated to their shortest unique prefix. You may use two hyphens instead of one to designate an option. You may use either white space or an equals sign between an option name and its value. -<H2 id="description">DESCRIPTION</H2> +<h2 id="description">DESCRIPTION</h2> <p>This program is part of <a href="index.html">Netpbm</a>. @@ -53,11 +53,11 @@ becomes black, the brightness that becomes white, and the brightness that becomes that middle value, <b>pnmnorm</b> computes a quadratic equation that maps all the other brightnesses from input values to output values. -<P>The program first determines a mapping of old brightness to new +<p>The program first determines a mapping of old brightness to new brightness. For each possible brightness of a pixel, the program determines a corresponding brightness for the output image. -<P>Then for each pixel in the image, the program computes a color which has +<p>Then for each pixel in the image, the program computes a color which has the desired output brightness and puts that in the output. With a color image, it is not always possible to compute such a color and retain any semblance of the original hue, so the brightest and dimmest pixels may only @@ -74,7 +74,7 @@ In the case of saturation, "brightness" is pretty much a misnomer, but you can use the brightness analogy to see what it does. In the analogy, bright means saturated and dark means unsaturated. -<P>Note that all of these are different from separately normalizing +<p>Note that all of these are different from separately normalizing the individual color components. <p>An alternative way to spread out the brightnesses in an image is @@ -86,26 +86,38 @@ gives you more contrast than <b>pnmnorm</b> does, but can considerably change the picture in exchange. -<H2 id="options">OPTIONS</H2> +<h2 id="options">OPTIONS</h2> -<P>By default, the darkest 2 percent of all pixels are mapped to +<p>In addition to the options common to all programs based on libnetpbm +(most notably <b>-quiet</b>, see <a href="index.html#commonoptions"> +Common Options</a>), <b>pnmnorm</b> recognizes the following +command line options: + +<p>By default, the darkest 2 percent of all pixels are mapped to black, and the brightest 1 percent are mapped to white. You can override this behavior and specify either a different percentage, or specific brightness values to map to black and to white, or just have the single greatest brightness map to white and the least brightness map to black. -<p>To specify a percentage, use the <B>-bpercent</B> and -<B>-wpercent</B> options, or you can specify the exact pixel values to -be mapped by using the <B>-bvalue</B> and <B>-wvalue</B> options. +<dl compact> +<dt><b>-bpercent</b> +<dt><b>-wpercent</b> +<dt><b>-bvalue</b> +<dt><b>-wvalue</b> + +<dd> +<p>To specify a percentage, use the <b>-bpercent</b> and +<b>-wpercent</b> options, or you can specify the exact pixel values to +be mapped by using the <b>-bvalue</b> and <b>-wvalue</b> options. You can get appropriate numbers for the options from <b>ppmhist</b>. If you just want to enhance the contrast, then choose values at elbows in the histogram; e.g. if value 29 represents 3% of the image but value 30 represents 20%, choose 30 for -<I>bvalue</I>. If you want to brighten the image, then set -<I>bvalue</I> to 0 and just fiddle with <I>wvalue</I>; similarly, to -darken the image, set <I>wvalue</I> to maxval and play with -<I>bvalue</I>. +<i>bvalue</i>. If you want to brighten the image, then set +<i>bvalue</i> to 0 and just fiddle with <i>wvalue</i>; similarly, to +darken the image, set <i>wvalue</i> to maxval and play with +<i>bvalue</i>. <p>If you specify both <b>-bvalue</b> and <b>-bpercent</b>, <b>pnmnorm</b> uses the one that produces the least change. The same goes for @@ -134,7 +146,7 @@ In that case, <b>pnmnorm</b> adjusts the percentile value as required. In the example, it uses 99 as the black value (like <b>-bvalue=99</b>). -<P>It is also possible for your <b>-bpercent</b> and <b>-wpercent</b> +<p>It is also possible for your <b>-bpercent</b> and <b>-wpercent</b> options to select the same brightness value for the stretch-to-white and stretch-to-black value because of the fact that <b>pnmnorm</b> can't subdivide a histogram cell. E.g. if an image is all brightness @@ -156,12 +168,17 @@ range expansion of 150% (from a range of 40 to a range of 100). That much stretching means two adjacent pixels that used to differ in intensity by 4 units now differ by 10, and that might be unsightly. +<dt><b>-bsingle</b> +<dd> <p>To specify that the single least brightness in the image should stretch to black in the output, specify <b>-bsingle</b>. To specify that the single greatest brightness in the image should stretch to white in the output, specify <b>-wsingle</b>. <b>-bsingle</b> and <b>-wsingle</b> were new in Netpbm 10.69 (December 2014). +<dt><b>-maxexpand</b> +<dd> + <p>So that you can put a limit on the amount of expansion without having to examine the image first, there is the <b>-maxexpand</b> option. It specifies the maximum expansion you will tolerate, as an @@ -176,18 +193,18 @@ amount you specified. <p>When <b>pnmnorm</b> limits the expansion because of <b>-maxexpand</b>, it tells you about it with a message like this: <pre> -<tt> +<span style="font-family: monospace"> limiting expansion of 150% to 50% -</tt> +</span> </pre> <p>In any case, <b>pnmnorm</b> tells you exactly what expansion it's doing, like this: <pre> -<tt> +<span style="font-family: monospace"> remapping 25..75 to 0..100 -</tt> +</span> </pre> <p>Before Netpbm 10.26 (December 2004), it was not valid to specify both @@ -195,19 +212,26 @@ doing, like this: <p><b>-maxexpand</b> was new in Netpbm 10.32 (February 2006). -<P>The <B>-keephues</B> option says to keep each pixel the same hue as +<dt><b>-keephues</b> +<dd> + +<p>This option says to keep each pixel the same hue as it is in the input; just adjust its brightness. You normally want this; the only reason it is not the default behavior is backward compatibility with a design mistake. -<p>By default, <B>pnmnorm</B> normalizes contrast in each component -independently (except that the meaning of the <B>-wpercent</B> and -<B>-bpercent</B> options are based on the overall brightnesses of the +<p>By default, <b>pnmnorm</b> normalizes contrast in each component +independently (except that the meaning of the <b>-wpercent</b> and +<b>-bpercent</b> options are based on the overall brightnesses of the colors, not each component taken separately). So if you have a color -which is intensely red but dimly green, <B>pnmnorm</B> would make the +which is intensely red but dimly green, <b>pnmnorm</b> would make the red more intense and the green less intense, so you end up with a different hue than you started with. +<dt><b>-midvalue=</b><i>N</i> +<dt><b>-middle=</b><i>N</i> +<dd> + <p>When you specify <b>-midvalue=</b><i>N</i>, <b>pnmnorm</b> uses a quadratic function to map old brightnesses to new ones, making sure that an old brightness of <i>N</i> becomes 50% bright in the output. You can override @@ -220,16 +244,16 @@ fit), <b>pnmnorm</b> just ignores your <b>-midvalue</b> and maps linearly. <b>-midvalue</b> and <b>-middle</b> were new in Netpbm 10.57 (December 2011). -<P>If you specify <B>-keephues</B>, <B>pnmnorm</B> would likely leave +<p>If you specify <b>-keephues</b>, <b>pnmnorm</b> would likely leave this pixel alone, since its overall brightness is medium. -<P><B>-keephues</B> can cause clipping, because a certain color may be +<p><b>-keephues</b> can cause clipping, because a certain color may be below a target intensity while one of its components is saturated. -Where that's the case, <B>pnmnorm</B> uses the maximum representable +Where that's the case, <b>pnmnorm</b> uses the maximum representable intensity for the saturated component and the pixel ends up with less overall intensity, and a different hue, than it is supposed to have. -<P>This option is meaningless on grayscale images. +<p>This option is meaningless on grayscale images. <p>When you <em>don't</em> specify <b>-keephues</b>, the <b>-luminosity</b>, <b>-colorvalue</b>, and <b>-saturation</b> options @@ -238,13 +262,17 @@ components), but are meaningless when it comes to applying the transfer function (since it is applied to each individual RGB component). -<P>Before Netpbm 9.25 (March 2002), there was no <B>-keephues</B> option. +<p>Before Netpbm 9.25 (March 2002), there was no <b>-keephues</b> option. +<dt><b>-luminosity</b> +<dt><b>-colorvalue</b> +<dt><b>-saturation</b> +<dd> <p><b>-luminosity</b>, <b>-colorvalue</b>, and <b>-saturation</b> determine what property of the pixels <b>pnmnorm</b> normalizes. I.e., what kind of brightness. You cannot specify more than one of these. -<P>The <B>-luminosity</B> option says to use the luminosity (i.e. the +<p>The <b>-luminosity</b> option says to use the luminosity (i.e. the "Y" in the YUV or YCbCr color space) as the pixel's brightness. The luminosity is a measure of how bright a human eye would find the color, taking into account the fact that the human eye is more sensitive to some @@ -252,21 +280,21 @@ RGB components than others. <p>This option is default. -<P>This option is meaningless on grayscale images. +<p>This option is meaningless on grayscale images. -<P>Before Netpbm 10.28 (August 2005), there was no <B>-luminosity</B> option, +<p>Before Netpbm 10.28 (August 2005), there was no <b>-luminosity</b> option, but its meaning was still the default. -<P>Before Netpbm 10.28 (August 2005), there was no <B>-colorvalue</B> option. +<p>Before Netpbm 10.28 (August 2005), there was no <b>-colorvalue</b> option. -<P>The <B>-colorvalue</B> option says to use the color value (i.e. the +<p>The <b>-colorvalue</b> option says to use the color value (i.e. the "V" in the HSV color space) as the pixel's brightness. The color value is the gamma-adjusted intensity of the most intense RGB component. -<P>This option is meaningless on grayscale images. +<p>This option is meaningless on grayscale images. -<P>Before Netpbm 10.28 (August 2005), there was no <B>-colorvalue</B> option. +<p>Before Netpbm 10.28 (August 2005), there was no <b>-colorvalue</b> option. <p>The <b>-saturation</b> option says to use the saturation (i.e. the "S" in the HSV color space) as the pixel's brightness. The @@ -279,28 +307,28 @@ intense RGB component (all intensities gamma-adjusted). <p>This option is meaningless on grayscale images. -<P>Before Netpbm 10.28 (August 2005), there was no <B>-colorvalue</B> option. - - - -<H2 id="seealso">SEE ALSO</H2> - -<B><A HREF="pnmhisteq.html">pnmhisteq</A></B>, -<B><A HREF="pamlevele.html">pamlevels</A></B>, -<B><A HREF="ppmhist.html">ppmhist</A></B>, -<B><A HREF="pgmhist.html">pgmhist</A></B>, -<B><A HREF="pambrighten.html">pambrighten</A></B>, -<B><A HREF="ppmdim.html">ppmdim</A></B>, -<B><A HREF="pnmgamma.html">pnmgamma</A></B>, -<B><A HREF="pnm.html">pnm</A></B> - -<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> -</UL> -</BODY> -</HTML> +<p>Before Netpbm 10.28 (August 2005), there was no <b>-colorvalue</b> option. + +</dl> + +<h2 id="seealso">SEE ALSO</h2> + +<b><a href="pnmhisteq.html">pnmhisteq</a></b>, +<b><a href="pamlevels.html">pamlevels</a></b>, +<b><a href="ppmhist.html">ppmhist</a></b>, +<b><a href="pgmhist.html">pgmhist</a></b>, +<b><a href="pambrighten.html">pambrighten</a></b>, +<b><a href="ppmdim.html">ppmdim</a></b>, +<b><a href="pnmgamma.html">pnmgamma</a></b>, +<b><a href="pnm.html">pnm</a></b> + +<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> +</ul> +</body> +</html> |