KK-Software Page1
Back to Homepage
Next page
Software Documentation
(This documentation may not be up to date. Please refer to KVEC.TXT in the KVEC package which you can download)
- ******************************************************************************
* K V E C D O C U M E N T A T I O N *
* *
* +++ KK-Software +++ KK-Software +++ KK-Software +++ KK-Software +++ *
*----------------------------------------------------------------------------*
* Dipl.-Phys. Karl-Heinz Kuhl, Joseph-Haas-Str. 7d, 92637 Weiden, Germany *
*----------------------------------------------------------------------------*
* Voice FAX E-Mail *
* +49 961 6340837 +49 961 61455 kkuhl@compuserve.com *
******************************************************************************
--------!-ABOUT_KVEC------------------------
What is KVEC?
KVEC is a shareware program that allows you to convert raster graphics to
vector graphics. You can freely use it for a trial period of 30 days. After
this period you must register it if you want to continue to use it.
The (unregistered) shareware version can be freely distributed
and copied.
KVEC is designed for 32 bit operating systems and is very exacting with
respect to memory demands. Vectorizing is a critical process and often leads
to a trade off between memory demands and performance.
It is crucial for the performance that your computer has enough
RAM and that you have a floating point coprocessor. A minimum of 16 MByte RAM
is recommended. KVEC works fine on a Pentium 100 MHz with 32 MByte.
The computing time on a Pentium 100 MHz is in the order of magnitude of
seconds up to minutes, depending on the size and the colour-depth of the
input file.
The selection of values for the switch parameters requires some caution.
Noisy pictures (typical for scanned colour pictures) or pictures with a lot of
very small details should be evaluated with larger 'grit values' and smaller
'quantize values' (explained below).
The output formats DXF and HPGL are not suited for vectorization of coloured
photos or coloured scanned pictures (unless you have lots of GigaBytes left
on your harddisk ;-) the output size would be immense.
Vector representations of images have several advantages in contrast to
rastered block representations: operations like rotation, stretching, morphing
and warping can much easier be performed and one does not have to care about
aliasing and other unwanted effects. The application fields of a good
vectorizer reach from motion estimating in video sequences up to effective
image compression.
Please feel free to contact the author if you have problems with KVEC
or if you find some bugs. KVEC is designed to run on several operating systems
(which have different hardware and graphical environments), therefore this
first release of KVEC is a graphic-independend commandline version.
The syntax is quite simple:
KVEC (Inputfile) (Outputfile) [optional switches]
for example:
KVEC test.bmp test.dxf -format dxf
You can also start KVEC using a parameter file (KVEC.PAR) by typing:
KVEC -readpar [filename]
[filename] is the (optional) name of a KVEC parameter file.
The name of the parameter file must be KVEC.PAR (uppercase), if no filename
for the parameter file is specified.
You can use any of the example parameter files in the KVEC package (*.par).
Inputfile is the name of a raster graphic file (Tiff, BMP, PCX, TGA, SGI,
IMG, PNM, JPEG, GIF, WPG or FAX).
If the name of the input-file is 'null' KVEC will create a 'white noise'
random or other test raster images.
If the name of the input-file is 'vnull' KVEC will create a random
vector image. The properties of this test image depend on
the parameter settings for the '-random' switch.
Outputfile is the name of the desired vector graphic file.
Please note that the name of the output file must be specified with the
filename extension. You cannot omit it.
Note:
KVEC version 1.62 or higher also accepts WMF or ART as input format.
If the input-file has already a vector-format (WMF or ART), most of the
switches will be disregarded. In this case KVEC only performs a format-
conversion from one vector format to another vector format.
KVEC version 1.92 or higher also accepts BMP or TIFF as output format.
If the input-file has already a raster-format, most of the
switches will be disregarded. In this case KVEC only performs a format-
conversion from one raster format to another raster format.
Currently supported vector formats are:
- Windows Metafile, Postscript, AutoCad DXF, HPGL, LogoArt ART,
Adobe Illustrator Format, XFIG, PCS and the KVEC format KVC
The switches are optional. If you don't specify any switches, the program
chooses a set of parameters which are optimized with respect to the kind of
graphic data. Switches may be abbreviated.
The filenames must be specified before the optional switches.
Some switches however don't require filenames and can be specified immediately
after KVEC. From these switches only one can be specified in each case:
--------!-ehelp-E---------------------------
KVEC -ehelp <topic> Displays help information in English language
--------!-ghelp-E---------------------------
KVEC -ghelp <topic> Displays help information in German language
--------!-info-E----------------------------
KVEC -info: Displays some useful information about KVEC on the screen.
--------!-printform-E-----------------------
KVEC -printform: Automatically generates a registration form. This form can
be sent to the author by E-Mail, Fax, or postal mail in
order to get a registration key. The registration key is
a max. 5 digit number, which allows the user to register
the software and get access to extended features of KVEC.
You will be prompted to select a language. The registration
form will then be generated in your preferred language.
The registration form consists of plain ASCII text.
If you print it out from a text processing program, be
sure that you choose a monospaced font and not a
proportional font.
--------!-register-E------------------------
KVEC -register: As soon as you get a registration key you can use this
switch to register the program. You will be prompted to
enter your name, the serial-number, and your registration
key. Please type all characters exactly as printed in the
registration confirmation you receive from the author. If
you have entered the information correctly, a message
appears which thanks you for your registration. The
received registration key is valid for updates and future
releases of KVEC.
--------!-readpar-E-------------------------
KVEC -readpar: KVEC reads filenames and additional parameters from a
parameter file (KVEC.PAR) rather than the commandline.
Please note, that the parameter file must reside in the
actual working directory. The parameter file KVEC.PAR
is an ASCI file and can be edited with any text editor.
Comments in the parameter file must be marked by a
#-character and may appear anywhere behind a parameter
or at the beginning of a line.
KVEC -readpar [filename]:
KVEC reads filenames and additional parameters from the
specified parameter file [filename].
--------!-writepar-E------------------------
KVEC -writepar: Generates a KVEC parameter file. The user will be prompted
to enter filenames and additional parameters.
The name of the parameter file is always 'KVEC.PAR'
and will reside in the actual directory.
You can add comments behind the parameters you are
promped to input (see above). Parameters always begin with
a leading '-'character. After the parameter file has been
written, the program should be restarted using the
'-readpar' option.
KVEC -writepar [filename]:
Generates a KVEC parameter file with the specified
filename.
--------!-end of writepar-E-----------------
The other switches must follow the input and output filenames:
--------!-bezier-E--------------------------
-bezier: The output will consist of bezier-curves instead of
straight lines. This allows you to zoom the image without
getting edges (for Postscript and LogoArt output only).
For the other output formats the bezier algorithm will
be simulated and approximated by polylines.
--------!-black-E---------------------------
-black: Output color for vectorization is always black
--------!-centerline-E----------------------
-centerline mixed: The effect of this parameter depends on the value of the
parameter -lwidth. (If used together with -centerline,
the meaning of the parameter -lwidth is modified).
Before vectorizing, all detected objects were checked for
its maximal thickness. All objects with a maximal
thickness less than -lwidth were treated as line objects;
all other objects were vectorized in the normal way.
The vectorization of line objects does not result in
border lines around the objects. It produces single lines
which are located along the centerlines of the objects.
The final linewidth of this generated single lines will
be adopted so that the area of the line object is about
the same as the area of the original object.
(this has no effect, if the output format cannot handle
variable linewidths). This is the DEFAULT.
-centerline lines: The same as 'centerline mixed' except that only line
objects will be generated. All other objects will be
discarded.
--------!-colspace-E------------------------
Selects the internal color space which is used by kvec.
The effect of changing the internal color space will be
noticed when used together with the "colorsep" option
or when bitmap processing is performed ("process" option).
-colspace rgb: RGB color space (default).
-colspace rb: RB color space
-colspace gb: GB color space
-colspace gr: RG color space
-colspace cmyk: CMYK color space
-colspace cy: CY color space
-colspace my: MY color space
-colspace mc: CM color space
Note: If a color space other than RGB or CMYK is selected,
the colors will be changed such that the optical
impression will be quite near to the original image.
--------!-colseparation-E-------------------
Selects the type of color separation. The output file
will only contain the specified color components.
Please note, that for cmyk separation the color space is
also set to the right value.
-colsep rgb: no color separation (default).
-colsep cmyk: no color separation
-colsep rb: extract R and B components
-colsep gb: extract G and B components
-colsep gr: extract R and G components
-colsep cy: extract C and Y components
-colsep my: extract M and Y components
-colsep mc: extract C and M components
-colsep rr: separate R color
-colsep gg: separate G color
-colsep bb: separate B color
-colsep cc: separate C color
-colsep mm: separate M color
-colsep yy: separate Y color
Note: It is useful to produce a gray-scale output file
for single component color separation. This can be
achieved by using the "-black" option together with colsep.
--------!-coord-E---------------------------
Specifies the type of internal scaling of coordinates
-coord optimize: coordinates may be rescaled in order to improve resolution
(default)
-coord pixel: the original pixel coordinate system will be used
--------!-dimension-E-----------------------
-dimension N: Specifies the maximum extension (in x- or y-direction)
of the generated output image. Default: 512 pixels.
IMPORTANT: This parameter will only be evaluated, if
the input file is of vector type (or 'null').
--------!-xdim-E-----------------------
-xdim N: Specifies the maximum extension (in x-direction)
of the generated output image. Default: original value
--------!-ydim-E-----------------------
-ydim N: Specifies the maximum extension (in y-direction)
of the generated output image. Default: original value
--------!-dither-E--------------------------
-dither off: Turns dithering off (Default)
-dither linear: Turns dithering on
Note: Dithering will only performed, if the output format
is a raster format.
--------!-dxfopt-E--------------------------
-dxfopt type 2dim: Generates 2-dimensional coordinates (if the output format
is DXF. (Default)
-dxfopt type 3dim: Generates 3-dimensional coordinates (if the output format
is DXF.
--------!-fill-E----------------------------
The fill parameters specify how the generated polylines/polygons will be
interpreted:
-fill solid: Polygons are always closed (i.e. the last point of a
vector is identical with the first point). The Polygons
are filled with individual colors (DEFAULT). The sort
parameter should not be 'min' in this case because the
larger Polygons would cover and hide the smaller ones.
-fill line: Output consists of polylines with individual colors. The
polylines are not closed. This is the preferable fill
parameter if the outputfile is generated for a pen-plotter.
The plotter pen will never plot more than one color one
upon another. The layout will depend on the sort order
specified with the 'sort' switch. With the switches
'reduce' and 'smooth' you can once more refine the layout
of the output.
-fill contour: The same as '-fill solid', however the interiors of the
polygons remain 'hollow'. Lines with different colour
can cover each other. The layout will depend on the
sort order specified with the 'sort' switch.
--------!-font-E----------------------------
-font: KVEC generates (before vectorization) an optimized set
of parameters, which is suited for vectorization of
dark colored text on a clear background. All objects
get a unique 'dark' color.
--------!-format-E--------------------------
The format parameters specify the output format:
-format wmf: Output format is Windows Metafile format, *.WMF
-format amf: Output format is ALDUS WMF Metafile (default), *.WMF
-format emf: Output format is Enhanced Windows Metafile format, *.EMF
-format ps: Output format is Postscript level 2, *.PS
-format eps: Output format is Encapsulated Postscript level 2, *.EPS
-format dxf: Output format is AutoCad DXF, *.DXF
-format hpgl: Output format is HPGL, *.HPG or *.PLT
-format art: Output format is ART LogoArt (OS/2-graphics program), *.ART
-format ai: Output format is Adobe Illustrator, *.AI
-format bmp: Output format is Windows Bitmap, *.BMP
-format tiff: Output format is Tiff, *.TIF
-format zyxel: Output format is ZYXEL FAX
-format kvc: Output format is KVEC vector format
-format xfig: Output format is XFIG vector format (Linux Drawing program)
-format pcs: Output format is Pfaff PCS vector format
--------!-gapfill-E-------------------------
-gapfill N: This parameter controls whether the vectorizer can 'jump'
over gaps while tracing an object. The value N must be
specified in 10ths of a pixel. Allowed values: 0 - 30.
--------!-grit-E----------------------------
-grit N: Polylines or polygons which belong to a bounded area with
a number of pixels fewer than N will be filtered out (i.e.
small details are 'erased'). The default value depends on
the dimensions and the colour depth of the picture. The
use of a grit value > 0 increases the computing time
and increases also considerably the demand of memory.
If you have to deal economically with memory you should
try a grit value of 0 and decrease the quantization value.
--------!-hatch-E---------------------------
The hatching parameters will only be evaluated if the output format is
DXF, PCS or HPGL.
-hatch1 density N: The max. number of horizontal hatch lines will be limited
to N (use 0 in order to turn off hatching)
-hatch2 density N: The max. number of vertical hatch lines will be limited
to N (use 0 in order to turn off hatching)
-hatch1 angle N: hatch angle for horizontal hatch lines (Default: 40 deg.)
-hatch2 angle N: hatch angle for vertical hatch lines (Default: 40 deg.)
--------!-justify-E-------------------------
The justify parameters will only be evaluated if input and output formats
are both raster type. The color depth of the input file must be 1 bit.
The main application for these options is justifying and cleaning
binary (B/W) scanned images in order to embed them into documents.
The default justify parameters are optimized for justifying and cleaning
DIN A4 images (300 dpi) containing text.
Carbon copies often have dirty black margins or are slightly distorted
by an small angle because the source got out of place while copying.
KVEC can automatically correct these errors, if you choose a proper set
of justify parameters.
-justify type off: No justification will be performed (default).
-justify type rotate:Justification will be performed only by rotation
-justify type all: Justification will be performed by rotation and cleaning
(cutting off) the dirty margins.
-justify phimax N: maximal allowed rotation angle. This is the max.
distortion angle which can be corrected. Please note
that the computional time increases linear with the
size of phimax. Default: 5.0 degrees
-justify parameter N1 N2 N3:
These values control the operation of the internal
algorithms (detecting large rectangular blocks from
which the rotation angle is deducted)
N1: 'thicking' factor. Each pixel will be enlarged by
this factor in order to make block structures
more detectable. Default: 16
N2: min. filter value. Regions with a coherent no. of
pixels less than N2 will be eliminated before the
internal block detection algorithm starts.
Default: 50
N3 max. filter value. Regions with a coherent no. of
pixels greater than N2 will be eliminated before the
internal block detection algorithm starts.
Default: 400
Note: The default parameter values are optimized for a
DIN A4 image (300 dpi resol.) containing an average text.
(the average size of charcters lies within the range
50 up to 400 pixels for a character).
This will ensure that only those parts of the image
which contain text information are relevant for the
computation of the rotation angle.
For other types of B/W images (electronic circuits or
plans) other values for N1, N2 and N3 may work better.
--------!-kvc-E-----------------------------
-kvc compress none: Disables any compression for the KVC Vector format
-kvc compress lzw: Applies the LZW compression technique to the KVC format
(lzw is the default compression)
-kvc bufsize <N>: Specifies the size of the packets which were compressed
--------!-lwidth-E--------------------------
-lwidth: Specifies the line width of the generated output vectors
in 10ths of a pixel.
Allowed values: 0-1000. Default value: 0.
Note that this parameter has a different meaning if
used together with the option -centerline.
In this case the default value for the lwidth is 100.
--------!-maxpoints-E-----------------------
-maxpoints: Specifies the max. no. of points which are allowed for
the generated polylines or polygons. This is useful if
KVEC produces vectors with more than 32767 points and
you use the WMF output format (WMF does not support
polylines with more than 32767 points)
--------!-mode-E----------------------------
-mode iso: Select isotropic mode. This mode preserves the the X/Y ratio
of the picture. (A circle will also be a circle in the
output picture). This is the default setting.
(PostScript and AI only)
-mode aniso: Select anisotropic mode. The picture will be scaled to fit
the whole papersize according to the selected paperformat.
(PostScript and AI only)
--------!-monitor-E-------------------------
-monitor: Turn on progress monitor. Information about the current
status and the progress of the program will be displayed.
--------!-overlapp-E------------------------
-overlap: If this switch is specified, Polygons will slightly
overlap, actually one pixel. (DEFAULT: no overlap).
If vector images show strange coloured gaps after they
have been rotated (especially along border lines between
adjacent Polygons) you should set this switch.
--------!-palette-E-------------------------
-palette optimize: KVEC will use internal optimzed palette when color
reducing has to be done (default)
-palette fixed: KVEC will use a standard color palette when color
reducing has to be done.
-palette user <n> R1,G1,B1, .... Rn,Gn,Bn:
Here you can specify a user supplied color palette which
contains <n> colors. The value <n> must be followed by
<n> RGB triples. It is more practicable to use a parameter
file than entering all RGB values on the commandline.
The value for n may not exceed 256 colors.
--------!-paper-E---------------------------
-paper (format): Select papersize. Currently this option is only valid
for the PostScript format. The format-string must be
one of the following:
'LETTER' (Letter 8 1/2 x 11 in)
'TABLOID' (Tabloid 11 x 17 in)
'LEDGER' (Ledger 17 x 11 in)
'LEGAL' (Legal 8 1/2 x 14 in)
'STATEMENT' (Statement 5 1/2 x 8 1/2 in)
'EXECUTIVE' (Executive 7 1/4 x 10 1/2 in)
'A3' (A3 297 x 420 mm)
'A4' (A4 210 x 297 mm)
'A5' (A5 148 x 210 mm)
'B4' (B4 (JIS) 250 x 354)
'B5' (B5 (JIS) 182 x 257 mm)
'FOLIO' (Folio 8 1/2 x 13 in)
'QUARTO' (Quarto 215 x 275 mm)
'10X14' (10x14 in)
'NOTE' (Note 8 1/2 x 11 in)
'ENV_9' (Envelope #9 3 7/8 x 8 7/8)
'ENV_10' (Envelope #10 4 1/8 x 9 1/2)
'ENV_11' (Envelope #11 4 1/2 x 10 3/8)
'ENV_12' (Envelope #12 4 \276 x 11)
'ENV_14' (Envelope #14 5 x 11 1/2)
'ENV_DL' (Envelope DL 110 x 220 mm)
'ENV_C5' (Envelope C5 162 x 229 mm)
'ENV_C3' (Envelope C3 324 x 458 mm)
'ENV_C4' (Envelope C4 229 x 324 mm)
'ENV_C6' (Envelope C6 114 x 162 mm)
'ENV_B4' (Envelope B4 250 x 353 mm)
'ENV_B5' (Envelope B5 176 x 250 mm)
'ENV_B6' (Envelope B6 176 x 125 mm)
'ENV_ITALY' (Envelope 110 x 230 mm)
'ENV_MONARCH' (Envelope Monarch 3.875 x 7.5 in)
'ENV_PERSONAL' (6 3/4 Envelope 3 5/8 x 6 1/2 in)
'FANFOLD_US' (US Std Fanfold 14 7/8 x 11 in)
'FANFOLD_STD_GERMAN' (German Std Fanfold 8 1/2 x 12 in)
'FANFOLD_LGL_GERMAN' (German Legal Fanfold 8 1/2 x 13 in)
'ISO_B4' (B4 (ISO) 250 x 353 mm)
'JAPANESE_POSTCARD' (Japanese Postcard 100 x 148 mm)
'9X11' (9 x 11 in)
'10X11' (10 x 11 in)
'15X11' (15 x 11 in)
'ENV_INVITE' (Envelope Invite 220 x 220 mm)
'A_PLUS' (SuperA/SuperA/A4 227 x 356 mm)
'B_PLUS' (SuperB/SuperB/A3 305 x 487 mm)
'A2' (A2 420 x 594 mm)
'A1' (A1 594 x 840 mm)
'A0' (A0 840 * 1188 mm)
--------!-pattern-E-------------------------
This parameter applies only to vector objects and is therefore without effect
for a pure raster-to-raster format conversion.
The last three parameters DR, DG and DB specify the max. color differences
used for color shading or random color patterns. Allowed values: 0 up to 255.
-pattern nodither D1 D2 D3: No color shading (default)
-pattern left2right D1 D2 D3: Color shading from left to right
-pattern right2left D1 D2 D3: Color shading from right to left
-pattern top2bottom D1 D2 D3: Color shading from top to bottom
-pattern bottom2top D1 D2 D3: Color shading from bottom to top
-pattern inout D1 D2 D3: Color shading from inside to outside
-pattern outin D1 D2 D3: Color shading from outside to inside
-pattern randrgb D1 D2 D3: Random color dithering
Important: Please note, that the specified vector output format must support
color shading. Currently only the KVC and ART format support color shading.
Color shading will always be done if you choose a raster output format and
your input file has a vector format.
--------!-quantize-E------------------------
-quantize N: The input file will be quantized down to N colors before
vectorization, if it contains more than N colours.
(Default: 32 colours).
For DXF and HPGL the default is 8 colors.
--------!-reduce-E--------------------------
The reduce parameters specify whether all those points of a vector laying on a
straight line may be replaced (= reduced) by two points (the start and the end
point of the straight line). This reduces the size of the outputfile.
Because straight lines can lie horizontally, vertically, or diagonally,
we have:
-reduce orthogonal:straight horizontal and vertical line-segments will be
reduced. This is the default value.
-reduce all: All straight lines will be reduced (diagonal lines too).
Occasionally, small gaps may appear in the layout.
-reduce off: lines will not be reduced. The only case in which you may
want this setting is when you want the velocity of a
plotter pen to slow down for long straight lines.
Next page