| 1 |
\ |
| 2 |
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |
| 3 |
.\" Do not hand-hack it! If you have bug fixes or improvements, please find |
| 4 |
.\" the corresponding HTML page on the Netpbm website, generate a patch |
| 5 |
.\" against that, and send it to the Netpbm maintainer. |
| 6 |
.TH "Pammasksharpen User Manual" 1 "14 June 2006" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
pammasksharpen - Sharpen an image via an unsharp mask |
| 10 |
|
| 11 |
.UN synopsis |
| 12 |
.SH SYNOPSIS |
| 13 |
|
| 14 |
\fBpammasksharpen\fP |
| 15 |
[\fB-sharpness=\fP\fIrealnum\fP] |
| 16 |
[\fB-threshold=\fP\fIrealnum\fP] |
| 17 |
\fImaskfile\fP [\fIinputfile\fP] |
| 18 |
.PP |
| 19 |
All options can be abbreviated to their shortest unique prefix. |
| 20 |
You may use two hyphens instead of one. You may separate an option |
| 21 |
name and its value with white space instead of an equals sign. |
| 22 |
|
| 23 |
.UN examples |
| 24 |
.SH EXAMPLES |
| 25 |
|
| 26 |
.nf |
| 27 |
pamgauss 5 5 -sigma=.7 -tupletype=GRAYSCALE | pamtopnm > gauss.pgm |
| 28 |
pnmconvol -nooffset gauss.pgm myimage.ppm > blurred.ppm |
| 29 |
pammasksharpen blurred.ppm myimage.ppm > sharpened.ppm |
| 30 |
|
| 31 |
.fi |
| 32 |
|
| 33 |
|
| 34 |
.UN description |
| 35 |
.SH DESCRIPTION |
| 36 |
.PP |
| 37 |
This program is part of |
| 38 |
.BR "Netpbm" (1)\c |
| 39 |
\&. |
| 40 |
.PP |
| 41 |
\fBpammasksharpen\fP reads a Netpbm image as input and produces a |
| 42 |
sharpened version of it, in the same format, as output. It does this |
| 43 |
via an unsharp mask, which you supply as another Netpbm image. |
| 44 |
.PP |
| 45 |
An unsharp mask is generally a blurred version of the original |
| 46 |
image. The sharpening computation is this: Calculate the |
| 47 |
"edgeness" of a sample in the input image as the signed |
| 48 |
difference between the sample value and the corresponding sample in |
| 49 |
the unsharp mask. This tells how different the pixel is from its |
| 50 |
neighbors. Add a multiple of the edgeness to the original sample to |
| 51 |
get the corresponding output sample. Clip as necessary. This causes |
| 52 |
pixels that are brighter than their neighbors to get even brighter, |
| 53 |
while pixels that are dimmer than their neighbors get even dimmer. |
| 54 |
This makes edges -- places where pixel values change quickly in space |
| 55 |
-- stand out more. |
| 56 |
.PP |
| 57 |
The unsharp mask must be the same dimensions and have the same maxval |
| 58 |
as the input image. |
| 59 |
|
| 60 |
.SS The Unsharp Mask |
| 61 |
.PP |
| 62 |
You usually create the unsharp mask as a Gaussian blur of the |
| 63 |
original image, which you can do using \fBpamgauss\fP and |
| 64 |
\fBpnmconvol\fP as in the example above. The convolution kernel you |
| 65 |
use with \fBpnmconvol\fP is normally a square with side length an odd |
| 66 |
number of pixels. |
| 67 |
.PP |
| 68 |
When you create an unsharp mask like this, you will have to choose |
| 69 |
the side length of the convolution kernel. That length implements the |
| 70 |
parameter of unsharp mask sharpening usually known as |
| 71 |
"radius." In particular, a radius of R pixels corresponds to a |
| 72 |
convolution kernel 2R+1 pixels on a side. |
| 73 |
.PP |
| 74 |
Radius is a very important parameter; you can ruin an image with a |
| 75 |
radius too large. You can safely use the highest radius with an |
| 76 |
inanimate object, while a human face demands the least. Landscapes |
| 77 |
fall in between. But it really depends on the size of the details. |
| 78 |
Fine detail needs a smaller radius, or else you may obliterate tiny |
| 79 |
detail of the same size as the Radius width. A large image often has |
| 80 |
larger detail (more pixels involved), so can use a larger radius. |
| 81 |
Radius and sharpness (see \fB-sharpness\fP option) interact: reducing |
| 82 |
one allows you to increase the other. |
| 83 |
|
| 84 |
.UN options |
| 85 |
.SH OPTIONS |
| 86 |
.PP |
| 87 |
In addition to the options common to all programs based on libnetpbm |
| 88 |
(most notably \fB-quiet\fP, see |
| 89 |
.UR index.html#commonoptions |
| 90 |
Common Options |
| 91 |
.UE |
| 92 |
\&), \fBpammasksharpen\fP recognizes the following |
| 93 |
command line options: |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
.TP |
| 98 |
\fB-sharpness=\fP\fIrealnum\fP |
| 99 |
This specifies the magnitude of the sharpening. It is the multiple |
| 100 |
of edgeness that gets added to each sample as described above. |
| 101 |
.sp |
| 102 |
\fIrealnum\fP is a nonnegative real decimal number. Zero means |
| 103 |
no sharpening at all. |
| 104 |
.sp |
| 105 |
This parameter is known as "amount" in ImageMagick. |
| 106 |
.sp |
| 107 |
The default is 1.0. |
| 108 |
.sp |
| 109 |
This option was new in Netpbm 10.30 (October 2005). Before that, |
| 110 |
the sharpness was always 1.0. |
| 111 |
|
| 112 |
.TP |
| 113 |
\fB-threshold=\fP\fIrealnum\fP |
| 114 |
This minimum amount of edgeness that will be considered edgeness |
| 115 |
at all. i.e. if the magnitude of the edgeness is less than this, |
| 116 |
\fBpammasksharpen\fP will treat the edgeness as zero. |
| 117 |
.sp |
| 118 |
A nonzero value may be necessary here to avoid speckling in smooth |
| 119 |
areas. |
| 120 |
.sp |
| 121 |
This is a fraction of the maxval (so it is in the range [0, 1.0]). |
| 122 |
.sp |
| 123 |
The default is 0. |
| 124 |
.sp |
| 125 |
This option was new in Netpbm 10.34 (June 2006). |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
.UN seealso |
| 130 |
.SH SEE ALSO |
| 131 |
.BR "pnmconvol" (1)\c |
| 132 |
\&, |
| 133 |
.BR "pamedge" (1)\c |
| 134 |
\&, |
| 135 |
.BR "pamsharpness" (1)\c |
| 136 |
\&, |
| 137 |
.BR "pamsharpmap" (1)\c |
| 138 |
\&, |
| 139 |
.BR "pamarith" (1)\c |
| 140 |
\&, |
| 141 |
.BR "pnm" (1)\c |
| 142 |
\&, |
| 143 |
.BR "pam" (1)\c |
| 144 |
\& |
| 145 |
|
| 146 |
|
| 147 |
.UN history |
| 148 |
.SH HISTORY |
| 149 |
.PP |
| 150 |
\fBpammasksharpen\fP was new in Netpbm 10.23 (July 2004). |
| 151 |
.SH DOCUMENT SOURCE |
| 152 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 153 |
source. The master documentation is at |
| 154 |
.IP |
| 155 |
.B http://netpbm.sourceforge.net/doc/pammasksharpen.html |
| 156 |
.PP |