Skip to content

Command Line

ImgScan is a command-line program. Each parameter is written as NAME=value, and parameters are separated by spaces:

Terminal window
Exe\ImgScan.exe IMAGE=<image> OUTPUT=<CAD file> EXPORT=<format> ^
PIXEL=<µm> THRESH=<0-255> TRASHNUM=<pixels> ^
ACCURACY=<1|2> BDWIDTH=<pixels> END
  • Write parameter names in capital letters. The order does not matter.
  • END closes the parameter list; anything after it is ignored.
  • Relative paths are relative to the current folder, which must be the ImgScan folder.
  • Paths must not contain spaces or commas, quoted or not. See path rules.

Parameters

ParameterValueDescription
IMAGEpathThe image to convert, a .bmp or .tif file. Required.
OUTPUTpathThe CAD file to write. The folder must exist; a file of the same name is replaced. Required.
EXPORTDXF, GERBER or ODB++The output format. Use the matching extension in OUTPUT: .dxf, .gbr or .tgz. Required.
PIXELnumber, µmSize of one pixel in micrometres. Sets the scale of the CAD data. Default 1.0.
THRESH0 – 255Gray level that separates artwork from background.
TRASHNUMpixelsSpecks smaller than this number of pixels are removed as noise. 0 keeps everything.
ACCURACY1 or 2Resolution of the raster and vector processing. 2 traces the more accurate outline.
BDWIDTHpixels, up to 2000Width of one processing band. Larger bands need more memory and give fewer band borders.
DEBUG–Prints the parameters and keeps the temporary files. For troubleshooting only.
END–Ends the parameter list.

ImgScan checks ACCURACY and BDWIDTH before it starts. A value out of range stops the run with an error message.

Calling ImgScan from a program

Set the working directory of the new process to the ImgScan folder, pass the parameters as above, wait for the process to end and test its exit code. Only exit code 0 means a new output file was written; after a failure ImgScan leaves no output file behind.

To run several conversions at the same time, give each its own OUTPUT file. Each run has its own temporary folder, so runs do not disturb each other; see processing and output.