WiseImage script commands (Reference)

Exit

Closes application
Format:
/Exit

SetLogFile

Creates a log file with the script execution date and all error messages that occurred during executing.
Format:
/SetLogFile[ FNAME]:””
Example: /SetLogFile:”C:\WISEIMAGE5\MyScript.log”

File processing commands

Open

Opens an existing document.
Format:
/Open[ FNAME]:”“
Example:
/Open:“C:\WISEIMAGE5\Samples\map.tif”

New

This creates a new document.
Format:
/New

Close

This closes the current document.
Format:
/Close

Save

This saves the current document to a file. If the current document cannot be saved in the current file, then this command will be ignored. This might happen, for example, when trying to save several images or vector objects in image format.
Format:
/Save

SaveAs

This saves the current document to a new file. It can be saved in Colour Workspace format (CWS) or AutoCAD file format (DXF, DWG).
Format:
/SaveAs[ FNAME]:”” FTYPE:”“
Example:
/SaveAs FNAME:“C:\WISEIMAGE5\Samples\test.cws” FTYPE:”cws”

Export

This exports current document in as a Colour Workspace file (CWS) or AutoCAD file (DXF, DWG).
Format:
/EXPORT[ FNAME]:”” FTYPE:””
Example:
/EXPORT:“C:\WISEIMAGE5\Samples\MyWorspace.cws” FTYPE:”cws”

InsertImage

This inserts an image from a file into the existing document.
Format:
/InsertImage[ FNAME]:”“
Example:
/Insert:“C:\WISEIMAGE5\Samples\map.tif”

SaveImageAs

This saves an image in a new image format.
Format:
/SaveImageAs[ INAME]:”” FNAME:”” FTYPE:”“
Example:
/SaveImageAs:”electr” FNAME:“C:\WISEIMAGE5\Samples\test.tif” FTYPE:”tif”

Print

This prints the specified area of the current document to the selected printer with the scale specified.
Format:
/PRINT [FIT | SCALE: ] [LEFT: TOP: RIGHT: BOTTOM: ] [NUMCOP:] [PNAME:””]
Description of Parameters:
FIT and SCALE
This specifies the print scale. With both parameters omitted, the command prints the image without scaling so that 1 image millimetre (or inch) represents 1 millimetre (or inch) on the paper.
FIT
This scales the print so that the portion of the document to be printed is made as large as possible for the specified paper size.
SCALE
Multiplies the print dimensions to the specified scale factor. For example, /PRINT SCALE:0.5 reduces the image by half before printing it.
LEFT, TOP, RIGHT, and BOTTOM
This defines the portion of the document to be printed. Each of these parameters defines the offset of the print area boundary. If the parameter value is positive, then the margin will be added to the appropriate boundary side. If it is negative, then the stripe of the defined width will be cut from the print area boundary. If some of these parameters are omitted, then the offsets will be equal to 0.
NUMCOP
This specifies the number of copies to print. If it is omitted, then the command prints one copy.
PNAME
This specifies the name of a printer. If it is omitted, then the command sends the output to the default Windows printer. The printer name should be typed as it appears in the Printer Name list box of the Print dialog.
Example:
/PRINT SCALE:2.5 LEFT:17.5 BOTTOM:10 NUMCOP:2

Acquire

Acquires the image using the specified TWAIN source, creates a new document consisting of one raster image, and places the result of acquiring on this image.
Format:
/Acquire DPI: BPP: [GREYSCALE] [SOURCE:”

”]
Description of Parameters:DPI
This specifies the scanner resolution in dots per inch.
BPP
This defines the number of colours to be used as colour depth in bits per pixel. Colour depth determines the number of bits used for colour representation when an image is being scanned. It may take the following values: 1, 4, 8, 16, and 24. For example, BPP: 1 value defines the bitonal scanning and BPP:24 value defines the TrueColour (RGB) scanning.
GREYSCALE
This forces the program into greyscale scanning mode. If this parameter is set, then define BPP = 8, or else the greyscale parameter will be ignored.
SOURCE
This specifies the name of the TWAIN source that will be used for acquiring the image. If it is omitted, then the program uses the default source.
Example:
/Acquire DPI:150 BPP:24

AcquireRaster

The image is acquired using the specified TWAIN source, creates a new raster image in the existing document, and places the result of acquiring on this image.
Format:
/AcquireRaster [RN:””] DPI: BPP: [GREYSCALE] [SOURCE:”

”]
Description of Parameters:
RN
This specifies the name of the raster that is used for the results of scanning.
DPI, BPP, GREYSCALE, SOURCE are described above in “Acquire”
Example: /AcquireRaster DPI:300 BPP:8 GREYSCALE

Entire Image Processing Commands

MirrorX

This flips the images about the X axis.
Format:
/MirrorX

MirrorY

This flips the images about the Y axis.
Format:
/MirrorY

Rotate90_CCW

This rotates the images 90 degrees counter clockwise about its centre point-.
Format:
/Rotate90_CCW

Rotate180

This rotates the images 180 degrees about its centre point.
Format:
/Rotate180

Rotate90_CW

This rotates the images 90 degrees clockwise about its centre point.
Format:
/Rotate90_CW

Rotate

This rotates the images by a user-defined angle about its centre point.
Format:
/Rotate[ ANGLE]:
Example:
/Rotate:45

AutoCrop

Automatically detects margins for the specified raster image and removes them.
Format:
/AutoCrop [[ERN]:””]
Description of Parameters:
ERN – name of the raster for margins detecting. It may be omitted if the document consists of one raster image.
Example:
/AutoCrop:”map”

Auto correct

Applies a sequence of operations specified in the Autocorrect item of the Preferences dialog box to the raster image.
Format:
/AutoCorrect[[ ERN]:””]
Description of Parameters:
ERN – name of the raster for automatic estimation and detection. It may be omitted if the document consists of one raster image.
Example:
/AutoCorrect:”cs_cam”

Deskew

Automatically estimates the raster image deviations from the horizontal and vertical and rotates the image about its centre point to align it vertically or horizontally.
Format:
/AutoDeskew[[ ERN]:””]
Description of Parameters:
ERN – name of the raster for automatic deskew angle estimation. It may be omitted if the document consists of one raster image.
Example:
/AutoDeskew:”vp_city”

Entire Image Processing Commands (resample family)

ChangeDPI

Scales the image dimensions in pixels by changing its resolution in dot-per-inch. The image dimensions in millimetres or inches will not be changed.
Format
/ChangeDPI[ DPI]:
Example:

The current image resolution is 150 dpi and it has dimensions
1500×1500 pixels or 10×10 inches /ChangeDPI: 300
The image resolution is 300 dpi and it has dimensions
3000×3000 pixels or 10×10 inches

SetDPI

Scales the image dimensions in millimetres or inches by setting the new resolution value in dot-per-inch. The image dimensions in pixels will not be changed.
Format:
/SetDPI[ DPI]:
Example:

The current image resolution is 150 dpi and it has dimensions of
1500×1500 pixels or 10×10 inches
/SetDPI:300
The image resolution is 300 dpi and its dimensions in pixels don’t
scale (1500×1500 pixels)
but its dimensions in inches are now equal to 5×5 inches

Resize

Scales the image so that its height (or width) in current linear units becomes equal to the specified value. If the RESAMPLE parameter is present, then the command scales the image dimensions in pixels. If it is omitted, then the command scales the image by changing the new resolution value.
Format:
/Resize WIDTH:| HEIGHT: [RESAMPLE]
Description of Parameters:
WIDTH and HEIGHT
Specify the new width or height for the image.
RESAMPLE
Defines whether the image dimensions in pixels will be changed or not.
Example:

Scale the image by changing its dimensions in /SetLinearUnits:
/Resize WIDTH:84 RESAMPLE

Scale

Scales the image. If the RESAMPLE parameter is present, then the command scales the image dimensions in pixels. If it is omitted, then the command scales the image by changing the resolution value.
Format:
/Scale[ SCFACT]: [RESAMPLE]
Description of Parameters:
SCFACT – scale factor.
Example: Enlarge the image twice by changing its dimensions in current linear units; (millimetres or inches) dimensions in pixels will not be changed. It means that the image DPI value will be decreased by half.
/Scale:2

ChangeSizeInPixels

Scales the image so that its height (or width) in pixels becomes equal to the specified value.
Format:
/ChangeSizeInPixels PWIDTH: | PHEIGHT:
Example: Scale the image by changing its dimensions in pixels so that the image height will be equal 1200 pixels
/ChangeSizeInPixels PHEIGHT:1200

Entire Image Processing Commands (image size family)

ChangeImageSize

Takes the original image and places it unchanged on a new image of the specified dimensions with the specified alignment.
Format:
/ChangeImageSize WIDTH: HEIGHT: [ALIGN:””] [LEFT:] [TOP:] [RIGHT:] [BOTTOM:]
Description of Parameters:
WIDTH
Width of the new image in the current linear units.
HEIGHT
Height of the new image in the current linear units.
ALIGN
Defines the type of alignment and specifies the available sequence of the LEFT, TOP, RIGHT, BOTTOM additional parameters. It may take the following values: LeftTop, Top, RightTop, Left, Centre, Right, LeftBottom, Bottom, or RightBottom. If this parameter value is Centre, then the original image centre point is always placed to the centre point of the new image and LEFT, TOP, RIGHT, BOTTOM are ignored. If one of the Top, Left, Right, Bottom values is used, then the image is aligned so that the centre point of the appropriate original image side is placed to the centre of the new image side. In such a case only one of the additional parameters is available. For example, if Top is used, the TOP parameter is available. When you use LeftTop, RightTop, LeftBottom, or RightBottom, the two appropriate additional parameters are available. For example, the LeftTop value indicates that the TOP and LEFT parameters are available and the RIGHT and BOTTOM parameters will be ignored.
LEFT, RIGHT
This defines the offset of the left or right original image side relative to the appropriate side of the new image. Only one of these parameters can be used at one time.
TOP, BOTTOM
This defines the offset of the top or bottom original image side in relation to the appropriate side of the new image. Only one of these parameters can be used at one time.
Example:
/ChangeImageSize WIDTH:85.27 HEIGHT:61 ALIGN:“LeftTop” LEFT:-20.3 TOP:12.4

FitToClosestPaper

This finds the standard paper format closest to the original image format and places the original image on a new image with the specified alignment.
The list of standard paper formats may be changed using the Papers item of the Preferences dialog box.
Format:
/FitToClosestPaper [ALIGN:””] [LEFT:] [TOP:] [RIGHT:] [BOTTOM:]
Description of Parameters:
ALIGN, LEFT, RIGHT, TOP, BOTTOM are described above in “ChangeImageSize” command description.
Example:
/FitToClosestPaper WIDTH:120 HEIGHT:80.5 ALIGN:“Bottom” BOTTOM:10

FitToPaper

Takes the original image and places it unchanged on a new image of the specified standard size with the specified alignment.
The list of standard paper formats may be changed using the Papers item of the Preferences dialog box.
Format:
/FitToPaper [PN]:”“ [O:]
[ALIGN:””] [LEFT:] [TOP:] [RIGHT:] [BOTTOM:]
Description of Parameters:
PN – Name of the standard paper format.
O – Orientation type (must have a numeric value):
1 – portrait orientation,
2 – landscape orientation.
ALIGN, LEFT, RIGHT, TOP, BOTTOM are described above in “ChangeImageSize”.
Example:
/FitToPaper PN:“ISO A2” O:2 ALIGN:”RightTop” RIGHT:20 TOP:10

ChangeMargins

Changes image size by adding or cutting specified margins.
Format:
/ChangeMargins [LEFT:] [TOP:] [RIGHT:] [BOTTOM:]
Description of Parameters:
LEFT, TOP, RIGHT, and BOTTOM
Each of these parameters defines the margin value for the appropriate image side. If the parameter value is positive, then the margin will be added to the appropriate image side. If it is negative, then the strip of the defined width will be cut from the image. If some of these parameters are omitted, the appropriate margin values for these will be set to 0.
Example:
/ChangeMargins LEFT:12.5 RIGHT:20 BOTTOM:12.5

Tools

Calibrate

This calibrates the image using the current calibration parameters or parameters defined by the specified template. If the template file is not stored in the default template directory, then a path must be defined for it.
Format:
/Calibrate[[ TEMPL]:””]
Example:
/Calibrate:“My_calibration.tpl”

Binarize

This binarizes the image using the current binarization parameters or parameters defined by the specified template. If the template file is not stored in the default template directory, then a path must be defined for it.
Format:
/Binarize[[ TEMPL]:””]
Example:
/Binarize:“map-rivers.tpl”

Colour Reduction

Performs colour reduction in the image using the current parameters or parameters defined by the specified template. If the template file is not stored in the default template directory, then a path must be defined for it.
Format:
/ReduceColours[[ TEMPL]:””]
Example:
;Template file is not situated in default template directory:
/ReduceColours TEMPL:“C:\MyTPLs\My_ColourReduction.tpl”

Colour Separation

Performs colour separation of the image using the current parameters or parameters defined by the specified template. If the template file is not stored in the default template directory, then a path must be defined for it.
Format:
/SeparateByColours[[TEMPL]:””]
Example:
/SeparateByColours:“map.tpl”

Separate By Size

Finds raster objects of the given size on the specified monochrome images and then moves the found objects onto a new layer.
Format:
/SeparateBySize RNS:”“[”“…]
OLN:”“ MIN: MAX:
Description of Parameters:
RNS – Names of monochrome raster images to find raster objects on
OLN –Name of new layer to place raster objects on
MIN, MAX – minimum and maximum sizes of objects to find.
Example:
Moves raster objects that are more than 2 mm and less then
3.5 mm from the “Texts” and ”Symbols” images of one layer to “Small Symbols” layer.
/SeparateBySize RNS: “Texts”+”Simbols” OLN:“Small Symbols “ MIN:2 MAX:3.5

Colour Correction Tools

Convert to 24 bit

Converts monochrome, greyscale, and 8 and 16 bit colour images to RGB colour images (24 bpp).
Format:
/ConvertToTrueColour

Equalize

Automatically redistributes the brightness values of the pixels in the images.
Format:
/AutoEqualize

Brightness/Contrast

This changes brightness, contrast, hue, and saturation values of the pixels in the images.
Format:
/ChangeLevels [B:] [C:] [H:] [S:]
B – The change of the brightness value from –100 to +100
C – The change of the contrast value from –100 to +100
H – The change of the hue value from –180 to +180
S – The change of the saturation value from –100 to +100
Example:
/ChangeLevels B: 10 C:-10

Colour Filters

 Colour filters are described from Modifying a Color Palette.

Blur

Format:
/Blur[ RAD]:
RAD – The change of the blur radius from 0.0 to 10.0 pixels
Example:
/Blur:3.7

Median

Format:
/Median[ RAD]:
RAD – The change of the median radius from 0 to 5 pixels
Example:
/Median:3

UnSharpMask

Format:
/UnSharpMask SENS: RAD:
SENS – The change of the sensitiveness value from 0% to 100%
RAD – The change of the unsharp radius from 0.0 to 10.0 pixels
Example:
/UnSharpMask SENS:35 RAD:6

Mono Filters

 Monochrome filters are described from page 151.

Invert

Format:
/Invert[[ RNS]:””[””…]]
RNS – Names of monochrome raster images to invert.
Example:
/Invert RNS:”cs_cam”+”vp_city”

Contour4

Format:
/Contour4[[ RNS]:””[””…]]
RNS – Names of monochrome raster images to create 4-coupling contours on.
Example:
/Contour4:”cs_mech”

Contour8

Format:
/Contour8[[ RNS]:””[””…]]
RNS – Names of monochrome raster images to create 8-coupling contours on.
Example:
/Contour8 RNS:”cs_map”

RemoveSpeckles

Format:
/RemoveSpeckles[ RNS:””[””…] [E I MIN: MAX:]
Description of Parameters:
RNS – Names of monochrome raster images to remove speckles from.
E – Estimates dimension of speckles to remove them automatically.
MIN, MAX – Minimal and maximal sizes of speckles to remove in default units.
Example:
/RemoveSpeckles RNS:”cs_plan” MIN:0.5 MAX:11.58

RemoveHoles

Format:
/RemoveHoles[ RNS:””[””…] [E I MIN: MAX:]
Description of Parameters:
RNS – Names of monochrome raster images to remove holes from.
E – Estimates dimension of holes to remove them automatically.
MIN, MAX – Minimal and maximal sizes of holes to remove in default units.
Example:
/RemoveHoles MIN:0.5 MAX:6.32

Smooth

Format:
/Smooth[ RNS:””[””…] M: T:
Description of Parameters:
RNS – Names of monochrome raster images to smooth.
M – Medianing degree from 0% to 100%.
T – Smoothing threshold from 0 to 255
Example:
/Smooth RNS:”cs_plan” M:50 T:120

Thin

Format:
/Thin[ RNS:””[””…] [S I NP:]
Description of Parameters:
RNS – Names of monochrome raster images to thinning.
S – Thin images up to skeleton.
NP – Number of thinning filter passes from 1 to 100.
Example:
/Thin NP:5

Thick

Format:
/Thick [RNS:””[””…] [DIR:] [NP:]
Description of Parameters:
RNS – Names of monochrome raster images to thicken.
DIR – Thickening direction:
0 – horizontal thickening,
1 – vertical thickening.
If the DIR parameter is omitted, then the thickening filter uses default directions.
NP – Number of thickening filter passes from 1 to 100.
If the NP parameter is omitted, then thickening filter uses one pass as default.
Example:
/Thick RNS:”cs_cam” DIR:0 NP:3

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment