Warning, /graphics/glaxnimate/external/potrace/doc/mkbitmap.1.in is written in an unsupported language. File is not indexed.
0001 .\" Copyright (C) 2001-2019 Peter Selinger. 0002 .\" This file is part of Potrace. It is free software and it is covered 0003 .\" by the GNU General Public License. See the file COPYING for details. 0004 .\" 0005 .TH mkbitmap 1 "@DATE@" "Version @VERSION@" 0006 .SH NAME 0007 mkbitmap \- transform images into bitmaps with scaling and filtering 0008 .SH SYNOPSIS 0009 0010 .nf 0011 .B mkbitmap [\fIoptions\fP] [\fIfilename...\fP] 0012 .fi 0013 .SH DESCRIPTION 0014 0015 \fBmkbitmap\fP reads an image, and applies one or more of the 0016 following operations to it, in this order: inversion, highpass 0017 filtering, scaling, and thresholding. Each operation can be 0018 individually controlled and turned on or off. 0019 0020 The principal use of \fBmkbitmap\fP is to convert color or greyscale 0021 images into a format suitable as input for other programs, 0022 particularly the tracing program \fBpotrace\fP(1). It is particularly 0023 useful for converting scanned line art, such as cartoons, handwritten 0024 text, etc., to high-resolution bilevel images. 0025 0026 \fIHighpass filtering\fP can be used to ensure that foreground 0027 features such as lines and text are preserved, while at the same time 0028 compensating for uneven background. Optional \fIblurring\fP can be 0029 applied to smooth out the image and remove visual noise. \fIScaling\fP 0030 is important because a scanned greyscale image contains more visual 0031 detail than a bilevel image at the same resolution. By scaling the 0032 image to a higher resolution (using interpolation) before thresholding 0033 it, some of this detail is preserved. \fIThresholding\fP means 0034 converting a greyscale image to a bilevel image using only black and 0035 white pixels. Pixels that are darker than a certain threshold value 0036 are converted to black. Optional \fIinversion\fP is useful if the 0037 input image shows bright features on dark background, such as a 0038 picture of chalk drawings on a blackboard. 0039 0040 Supported input formats are PNM (PBM, PGM, PPM) and BMP. The output 0041 formats are PBM for bitmaps, and PGM for greymaps. 0042 .SH OPTIONS 0043 0044 .SS General options: 0045 .TP 15 0046 .B -h, --help 0047 print help message and exit. 0048 .TP 0049 .B -v, --version 0050 print version info and exit. 0051 .TP 0052 .B -l, --license 0053 print license info and exit. 0054 .PD 0055 .SS Input/output options: 0056 .TP 15 0057 .B \fIfilename\fP 0058 If filename arguments are given, then \fBmkbitmap\fP will by default 0059 create one output file for each input filename given. The name of the 0060 output file is obtained from the input filename by changing its suffix 0061 to ".pbm" or ".pgm". If the name of the input file and output file 0062 would be identical, then an additional suffix "-out" is appended to 0063 the output filename. If no filename arguments are given, then 0064 \fBmkbitmap\fP acts as a filter, reading from standard input and 0065 writing to standard output. A filename of "-" may be given to specify 0066 reading from standard input; the output for this argument will then be 0067 written to standard output. Each input file may contain one or more 0068 images. 0069 .TP 0070 .B -o \fIfilename\fP, --output \fIfilename\fP 0071 write output to this file. All output is concatenated and directed to 0072 the specified file. This overrides the default behavior of creating 0073 one output file for each input file. A filename of "-" may be given to 0074 specify writing to standard output. 0075 .PD 0076 .SS Image processing options: 0077 .TP 15 0078 .B -x, --nodefaults 0079 Turn off default options. Normally, the following options are 0080 preselected by default: \fB-f 4 -s 2 -3 -t 0.45\fP. The \fB-x\fP option 0081 disables these defaults; thus, \fBmkbitmap -x\fP does nothing but copy 0082 a greyscale image from the input to the output. Other processing 0083 options can then be added one by one; e.g., \fBmkbitmap -xf10\fP does 0084 only highpass filtering, \fBmkbitmap -xt0.5\fP does only thresholding, 0085 etc. 0086 .TP 0087 .B -i, --invert 0088 Invert the input image. If this option is chosen, it is applied to the 0089 image before any other operation. It is used to deal with 0090 white-on-black images, such as photographs of chalk drawings on a 0091 blackboard. Note that the behavior of this option is not in general 0092 the same as inverting the \fIoutput\fP bitmap, unless the thresholding 0093 value is also inverted. 0094 .TP 0095 .B -f \fIn\fP, --filter \fIn\fP 0096 Apply a highpass filter to the image. This filter is approximately 0097 Gaussian and non-directional. The effect is to preserve small detail 0098 while compensating for background gradients. The parameter \fIn\fP is 0099 a radius (in pixels) which corresponds approximately to the size of 0100 details which should be preserved. More precisely, the filter is 0101 implemented by subtracting a blurred version of the image from the 0102 original image. The parameter \fIn\fP is equal to the standard 0103 deviation of the blur. The output of the filtering step is a 0104 normalized image whose average brightness is exactly 0.5. The default 0105 filter radius is 4. 0106 .TP 0107 .B -n, --nofilter 0108 Turn off highpass filtering. 0109 .TP 0110 .B -b \fIn\fP, --blur \fIn\fP 0111 Blur the image. The effect is to smooth out fine details and to 0112 reduce visual noise in the image. The parameter \fIn\fP is the 0113 blurring radius, and should be chosen small (1 is a good value to 0114 start with). This is implemented as an approximately Gaussian, 0115 non-directional blur with standard deviation proportional to 0116 \fIn\fP. Blurring is applied after the highpass filter, but before 0117 scaling and thresholding. If this option is not given, the default is 0118 not to apply any blurring. 0119 .TP 0120 .B -s \fIn\fP, --scale \fIn\fP 0121 Scale the image by an integer factor \fIn\fP>0. Scaling is done after 0122 highpass filtering, but before the thresholding step. A scaling factor 0123 of 1 indicates that no scaling is to be done. Otherwise, interpolation is 0124 used to fill in the in-between pixels. If the output of \fBmkbitmap\fP 0125 is to be used as input to a tracing program such as \fBpotrace\fP, a 0126 scaling factor of 2 is recommended. This preserved the right amount of 0127 detail for the tracing algorithm to work well. If a scaling factor of 0128 1 is used, too much detail is lost. If a scaling factor of 3 or higher 0129 is used, the interpolation tends to "invent" detail which was not 0130 present in the original image, thus preventing \fBpotrace\fP from 0131 doing a good job. 0132 .TP 0133 .B -1, --linear 0134 Use linear interpolation when scaling to a higher resolution. This is 0135 slightly faster, but less nice, than the default cubic interpolation. 0136 .TP 0137 .B -3, --cubic 0138 Use cubic interpolation when scaling to a higher resolution. This is 0139 the default. It is slower than linear interpolation, but leads to 0140 better results. 0141 .TP 0142 .B -t \fIn\fP, --threshold \fIn\fP 0143 Set the threshold grey value for bilevel conversion. The parameter 0144 \fIn\fP is a brightness value between 0 for black and 1 for white. 0145 Any pixels below this brightness will be converted to black (thus, 0146 smaller values of \fIn\fP will lead to whiter output). 0147 .TP 0148 .B -g, --grey 0149 Disable bilevel conversion. If this option is given, processing stops 0150 after the scaling step and a greymap is output. 0151 .PD 0152 .SH EXIT STATUS 0153 0154 The exit status is 0 on successful completion, 1 if the command line 0155 was invalid, and 2 on any other error. 0156 .SH VERSION 0157 0158 @VERSION@ 0159 .SH AUTHOR 0160 0161 Peter Selinger <selinger at users.sourceforge.net> 0162 .SH WEB SITE AND SUPPORT 0163 0164 \fBmkbitmap\fP is distributed as part of the \fBpotrace\fP package, 0165 and the latest version is available from 0166 http://potrace.sourceforge.net/. This site also contains 0167 documentation and information on how to obtain support. 0168 .SH SEE ALSO 0169 0170 \fBpotrace\fP(1) 0171 .SH COPYRIGHT 0172 0173 Copyright (C) 2001-2019 Peter Selinger 0174 0175 This program is free software; you can redistribute it and/or modify 0176 it under the terms of the GNU General Public License as published by 0177 the Free Software Foundation; either version 2 of the License, or 0178 (at your option) any later version. 0179 0180 This program is distributed in the hope that it will be useful, 0181 but WITHOUT ANY WARRANTY; without even the implied warranty of 0182 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0183 GNU General Public License for more details. 0184 0185 You should have received a copy of the GNU General Public License 0186 along with this program; if not, write to the Free Software Foundation, 0187 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0188 See also http://www.gnu.org/.