Bug#1082622: extendedopacity.5: Some remarks and editorial changes for this man page
Bjarni Ingi Gislason
bjarniig at simnet.is
Mon Sep 23 14:02:32 BST 2024
Package: netpbm
Version: 2:11.07.00-2
Severity: minor
Tags: patch
* What led up to the situation?
Checking for defects with
[test-]groff -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z < "man page"
[test-groff is a script in the repository for "groff"] (local copy and
"troff" slightly changed by me).
* What was the outcome of this action?
troff: backtrace: file '<stdin>':61
troff:<stdin>:61: warning: macro 'IMG' not defined
* What outcome did you expect instead?
No output (no warnings).
-.-
General remarks and further material, if a diff-file exist, are in the
attachments.
-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.10.9-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages netpbm depends on:
ii libc6 2.40-2
ii libjpeg62-turbo 1:2.1.5-3
ii libnetpbm11t64 2:11.07.00-2
ii libpng16-16t64 1.6.43-5
ii libtiff6 4.5.1+git230720-5
ii libx11-6 2:1.8.7-1+b1
ii libxml2 2.9.14+dfsg-1.3+b3
ii zlib1g 1:1.3.dfsg+really1.3.1-1
Versions of packages netpbm recommends:
ii ghostscript 10.03.1~dfsg-2
netpbm suggests no packages.
-- no debconf information
-------------- next part --------------
Any program (person), that produces man pages, should check its content for
defects by using
groff -mandoc -t -ww -b -z [ -K utf8 | k ] <man page>
The same goes for man pages that are used as an input.
For a style guide use
mandoc -T lint
-.-
So any 'generator' should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.
This is just a simple quality control measure.
The 'generator' may have to be corrected to get a better man page,
the source file may, and any additional file may.
Common defects:
Input text line longer than 80 bytes.
Not removing trailing spaces (in in- and output).
The reason for these trailing spaces should be found and eliminated.
Not beginning each input sentence on a new line.
Lines should thus be shorter.
See man-pages(7), item 'semantic newline'.
-.-
The difference between the formatted outputs can be seen with:
nroff -mandoc <file1> > <out1>
nroff -mandoc <file2> > <out2>
diff -u <out1> <out2>
and for groff, using
"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - "
instead of \'nroff -mandoc\'
Add the option \'-t\', if the file contains a table.
Read the output of \'diff -u\' with \'less -R\' or similar.
-.-.
If \'man\' (man-db) is used to check the manual for warnings,
the following must be set:
The option "-warnings=w"
The environmental variable:
export MAN_KEEP_STDERR=yes (or any non-empty value)
or
(produce only warnings):
export MANROFFOPT="-ww -b -z"
export MAN_KEEP_STDERR=yes (or any non-empty value)
-.-.
Output from "mandoc -T lint extendedopacity.5": (possibly shortened list)
mandoc: extendedopacity.5:6:54: WARNING: missing date, using "": TH
mandoc: extendedopacity.5:12:2: WARNING: skipping paragraph macro: PP after SH
mandoc: extendedopacity.5:22:2: WARNING: skipping paragraph macro: PP after SS
mandoc: extendedopacity.5:58:2: WARNING: skipping paragraph macro: PP after SS
mandoc: extendedopacity.5:64:2: ERROR: skipping unknown macro: .IMG -C blend1.gif
mandoc: extendedopacity.5:67:2: WARNING: skipping paragraph macro: PP after SS
mandoc: extendedopacity.5:81:2: WARNING: skipping paragraph macro: PP after SS
mandoc: extendedopacity.5:95:2: WARNING: skipping paragraph macro: PP after SS
mandoc: extendedopacity.5:118:2: WARNING: skipping paragraph macro: PP after SS
mandoc: extendedopacity.5:127:2: WARNING: skipping paragraph macro: PP after SS
mandoc: extendedopacity.5:153:2: WARNING: skipping paragraph macro: PP after SS
mandoc: extendedopacity.5:155:59: STYLE: whitespace at end of input line
mandoc: extendedopacity.5:156:36: STYLE: whitespace at end of input line
mandoc: extendedopacity.5:158:2: WARNING: skipping paragraph macro: PP empty
mandoc: extendedopacity.5:159:2: WARNING: line scope broken: SH breaks B
mandoc: extendedopacity.5:159:3: STYLE: whitespace at end of input line
mandoc: extendedopacity.5:166:2: WARNING: skipping paragraph macro: PP empty
-.-.
Remove space characters at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".
155:P. Haeberli and D. Voorhies. \fIImage Processing by Linear
156:Interpolation and Extrapolation\fP.
159:.B
-.-.
Change - to \- if it shall be printed as a minus sign.
extendedopacity.5:30:Blend fractions (alpha) and (1 - alpha) are used in a weighted average
extendedopacity.5:34: out = (1 - alpha)*in0 + alpha*in1
-.-.
Move a full stop (period) and a comma outside of a quoted text, if it is
at the end of the quote and does not end a quoted sentence.
46:image is used as the image to get "away from." Extrapolating away from
-.-.
Change a HYPHEN-MINUS (code 0x2D) to a minus(-dash) (\-),
if it
is in front of a name for an option,
is a symbol for standard input,
is a single character used to indicate an option,
or is in the NAME section (man-pages(7)).
N.B. - (0x2D), processed as a UTF-8 file, is changed to a hyphen
(0x2010, groff \[u2010] or \[hy]) in the output.
10:extendedopacity - theory of netpbm interpolation and extrapolation
30:Blend fractions (alpha) and (1 - alpha) are used in a weighted average
34: out = (1 - alpha)*in0 + alpha*in1
64:.IMG -C blend1.gif
74:.IMG -C blend3.gif
92:.IMG -C blend4.gif
108:.IMG -C blend6.gif
124:.IMG -C blend7.gif
160:.IMG -C gobot.gif
-.-.
Wrong distance between sentences in the input file.
Separate the sentences and subordinate clauses; each begins on a new
line. See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").
The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.
Remember coding: Only one command ("sentence") on each (logical) line.
E-mail: Easier to quote exactly the relevant lines.
Generally: Easier to edit the sentence.
Patches: Less unaffected text.
Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.
The amount of space between sentences in the output can then be
controlled with the ".ss" request.
N.B.
The number of lines affected can be too large to be in a patch.
83:pixel's luminance value. By using a black-and-white image as the
155:P. Haeberli and D. Voorhies. \fIImage Processing by Linear
157:IRIS Universe Magazine No. 28, Silicon Graphics, Aug, 1994.
-.-.
Output from "test-groff -b -mandoc -rF0 -rHY=0 -K utf8 -t -ww -z ":
troff: backtrace: file '<stdin>':64
troff:<stdin>:64: warning: macro 'IMG' not defined
troff: backtrace: file '<stdin>':155
troff:<stdin>:155: warning: trailing space in the line
troff: backtrace: file '<stdin>':156
troff:<stdin>:156: warning: trailing space in the line
troff: backtrace: file '<stdin>':166
troff:<stdin>:166: warning: macro 'PP.do' not defined (possibly missing space after 'PP')
-------------- next part --------------
--- extendedopacity.5 2024-09-23 12:59:24.542717401 +0000
+++ extendedopacity.5.new 2024-09-23 12:50:22.627285210 +0000
@@ -1,4 +1,4 @@
-\
+.\"
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
.\" Do not hand-hack it! If you have bug fixes or improvements, please find
.\" the corresponding HTML page on the Netpbm website, generate a patch
@@ -7,9 +7,8 @@
Created: 17 April 2003
.SH NAME
-extendedopacity - theory of netpbm interpolation and extrapolation
+extendedopacity \- theory of netpbm interpolation and extrapolation
.SH DESCRIPTION
-.PP
This page is a copy of http://www.sgi.com/misc/grafica/interp/ on
April 17, 2003, with some slight formatting changes, included in the
Netpbm documentation for convenience. Since at least June 11, 2005,
@@ -19,7 +18,6 @@ the source page has been missing.
\fIPaul Haeberli and Douglas Voorhies\fP
.SS Introduction
-.PP
Interpolation and extrapolation between two images offers a general,
unifying approach to many common point and area image
processing operations. Brightness, contrast, saturation, tint, and
@@ -27,11 +25,11 @@ sharpness can all be controlled with one
simultaneously. In several cases, there are also performance benefits.
.PP
Linear interpolation is often used to blend two images.
-Blend fractions (alpha) and (1 - alpha) are used in a weighted average
+Blend fractions (alpha) and (1 \- alpha) are used in a weighted average
of each component of each pixel:
.nf
- out = (1 - alpha)*in0 + alpha*in1
+ out = (1 \- alpha)*in0 + alpha*in1
.fi
.PP
@@ -43,7 +41,7 @@ Values above one subtract a portion of i
below 0.0 have the opposite effect.
.PP
Extrapolation is particularly useful if a degenerate version of the
-image is used as the image to get "away from." Extrapolating away from
+image is used as the image to get "away from". Extrapolating away from
a black-and-white image increases saturation. Extrapolating away from a
blurred image increases sharpness. The interpolation/extrapolation
formula offers one-parameter control, making display of a series of
@@ -55,44 +53,41 @@ However other processing is possible, fo
of X and Y, or where a brush footprint controls alpha near the cursor.
.SS Changing Brightness
-.PP
To control image brightness, we use pure black as the degenerate (zero
alpha) image. Interpolation darkens the image, and extrapolation
brightens it. In both cases, brighter pixels are affected more.
.B brightness
-.IMG -C blend1.gif
+.IMG \-C blend1.gif
.SS Changing Contrast
-.PP
Contrast can be controlled using a constant gray image with the average image
luminance. Interpolation reduces contrast and extrapolation boosts it.
Negative alpha generates inverted images with varying contrast. In
all cases, the average image luminance is constant.
.B contrast
-.IMG -C blend3.gif
+.IMG \-C blend3.gif
.PP
If middle gray or the average pixel color is used instead, contrast is
again altered, but with middle gray or the average color left unaffected.
Shades and colors far away from the chosen value are most affected.
.SS Changing Saturation
-.PP
To alter saturation, pixel components must move towards or away from the
-pixel's luminance value. By using a black-and-white image as the
-degenerate version, saturation can be decreased using interpolation, and
-increased using extrapolation. This avoids computationally more
-expensive conversions to and from HSV space. Repeated update in
-an interactive application is especially fast, since the luminance
-of each pixel need not be recomputed. Negative alpha preserves luminance
-but inverts the hue of the input image.
+pixel's luminance value.
+By using a black-and-white image as the degenerate version,
+saturation can be decreased using interpolation, and
+increased using extrapolation.
+This avoids computationally more expensive conversions to and from HSV space.
+Repeated update in an interactive application is especially fast,
+since the luminance of each pixel need not be recomputed.
+Negative alpha preserves luminance but inverts the hue of the input image.
.B saturation
-.IMG -C blend4.gif
+.IMG \-C blend4.gif
.SS Sharpening an Image
-.PP
Any convolution, such as sharpening or blurring, can be adjusted by
this approach.
If a blurred image is used as the degenerate image,
@@ -105,7 +100,7 @@ separable operation, sharpening by extra
efficient for large kernels.
.B sharpening
-.IMG -C blend6.gif
+.IMG \-C blend6.gif
.PP
Note that global contrast control, local contrast control, and
sharpening form a continuum.
@@ -115,16 +110,14 @@ similar, but uses local area luminance.
case, using only the color of nearby pixels.
.SS Combined Processing
-.PP
An unusual property of this interpolation/extrapolation approach is that
all of these image parameters may be altered simultaneously. Here
sharpness, tint, and saturation are all altered.
.B combined
-.IMG -C blend7.gif
+.IMG \-C blend7.gif
.SS Conclusion
-.PP
Image applications frequently need to produce multiple degrees of
manipulation interactively.
Image applications frequently need to interactively manipulate
@@ -150,17 +143,15 @@ It is surprising and unfortunate how man
needlessly limit interpolant values to the range 0.0 to 1.0. Application
developers should allow users to extrapolate parameters when practical.
.SS References
-.PP
For a slightly extended version of this article, see:
-P. Haeberli and D. Voorhies. \fIImage Processing by Linear
-Interpolation and Extrapolation\fP.
-IRIS Universe Magazine No. 28, Silicon Graphics, Aug, 1994.
+P.\& Haeberli and D.\& Voorhies.
+\fIImage Processing by Linear Interpolation and Extrapolation\fP.
+IRIS Universe Magazine No.\& 28, Silicon Graphics, Aug, 1994.
.PP
-.B
-.IMG -C gobot.gif
+.B
+.IMG \-C gobot.gif
.SH DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML
source. The master documentation is at
.IP
.B http://netpbm.sourceforge.net/doc/extendedopacity.html
-.PP
More information about the Pkg-phototools-devel
mailing list