Command Line
ImgScan is a command-line program. Each parameter is written as NAME=value, and parameters are separated by spaces:
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.
ENDcloses the parameter list; anything after it is ignored.- Relative paths are relative to the current folder, which must be the
ImgScanfolder. - Paths must not contain spaces or commas, quoted or not. See path rules.
Parameters
| Parameter | Value | Description |
|---|---|---|
IMAGE | path | The image to convert, a .bmp or .tif file. Required. |
OUTPUT | path | The CAD file to write. The folder must exist; a file of the same name is replaced. Required. |
EXPORT | DXF, GERBER or ODB++ | The output format. Use the matching extension in OUTPUT: .dxf, .gbr or .tgz. Required. |
PIXEL | number, µm | Size of one pixel in micrometres. Sets the scale of the CAD data. Default 1.0. |
THRESH | 0 – 255 | Gray level that separates artwork from background. |
TRASHNUM | pixels | Specks smaller than this number of pixels are removed as noise. 0 keeps everything. |
ACCURACY | 1 or 2 | Resolution of the raster and vector processing. 2 traces the more accurate outline. |
BDWIDTH | pixels, up to 2000 | Width 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.