JavaScript

PhenoCapture Scripting API Reference (JavaScript (Node.js / Browser))

Welcome to the complete PhenoCapture Scripting API Reference (JavaScript (Node.js / Browser)). Click on any of the class headers below to reveal its function list, and click on any function name to view its full syntax, parameter type table, return value, and code examples.


1. action Object (ScriptActionHelper)

The Action object provides programmatic access to all core image processing filters, AI neural operations, color channel manipulations, workspace file operations, hardware capture triggers, and batch analysis functions in PhenoCapture.

System & Workspace Actions

action.activateundoengine() – Activates the undo history engine on the active workspace canvas

Description: Activates the undo history engine on the active workspace canvas.

Syntax: await action.activateundoengine();

Parameters: None

Return Value: None

JavaScript (Node.js / Browser) Example:

action.activateundoengine();

action.deactivateundoengine() – Deactivates the undo history engine on the active workspace canvas

Description: Deactivates the undo history engine on the active workspace canvas.

Syntax: await action.deactivateundoengine();

Parameters: None

Return Value: None

JavaScript (Node.js / Browser) Example:

action.deactivateundoengine();

action.saveworkspaceas() – Opens a dialog to save the entire current workspace

Description: Opens a dialog to save the entire current workspace.

Syntax: await action.saveworkspaceas();

Parameters: None

Return Value: None

JavaScript (Node.js / Browser) Example:

action.saveworkspaceas();

action.saveworkspaceselectionas() – Opens a dialog to save the currently selected area of the workspace

Description: Opens a dialog to save the currently selected area of the workspace.

Syntax: await action.saveworkspaceselectionas();

Parameters: None

Return Value: None

JavaScript (Node.js / Browser) Example:

action.saveworkspaceselectionas();

action.saveimage(sourceBitmap, destFileName, jpegQuality) – Writes a GDI+ bitmap object directly to a specified file path on disk with custom JPEG quality settings

Description: Writes a GDI+ bitmap object directly to a specified file path on disk with custom JPEG quality settings.

Syntax: const result = await action.saveimage(sourceBitmap, destFileName, jpegQuality);

Parameter Description
sourceBitmap (Bitmap) GDI+ Bitmap object to save
destFileName (String) Full destination path on disk
jpegQuality (Integer, Optional) JPEG compression quality (1-100)

Return Value: String

JavaScript (Node.js / Browser) Example:

let img;, errStr;
img = action.getimage();
errStr = action.saveimage();

action.saveimagedialog(targetBitmap, selectedExtension, selectedQuality) – Opens a save image dialog with the specified bitmap, extension, and quality

Description: Opens a save image dialog with the specified bitmap, extension, and quality.

Syntax: await action.saveimagedialog(targetBitmap, selectedExtension, selectedQuality);

Parameter Description
targetBitmap (Bitmap) GDI+ Bitmap object to save
selectedExtension (String) Default file extension for the dialog
selectedQuality (Integer) Default image quality setting

Return Value: None

JavaScript (Node.js / Browser) Example:

action.saveimagedialog();

action.saveimageaction(outputFolder, prefix, suffix, formatType, quality) – Executes a save image action based on specified folder, prefix, suffix, and formatting options

Description: Executes a save image action based on specified folder, prefix, suffix, and formatting options.

Syntax: const result = await action.saveimageaction(outputFolder, prefix, suffix, formatType, quality);

Parameter Description
outputFolder (String, Optional) Target directory for saving
prefix (String, Optional) Prefix for the filename
suffix (String, Optional) Suffix for the filename
formatType (Integer, Optional) Save image format type
quality (Integer, Optional) Image compression quality

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.saveimageaction();

Edit & Selection Actions

action.expandselection(expandByPixels) – Expands the current selection by a specified number of pixels

Description: Expands the current selection by a specified number of pixels.

Syntax: const result = await action.expandselection(expandByPixels);

Parameter Description
expandByPixels (Integer, Optional) Number of pixels to expand

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.expandselection();

action.shrinkselection(shrinkByPixels) – Shrinks the current selection by a specified number of pixels

Description: Shrinks the current selection by a specified number of pixels.

Syntax: const result = await action.shrinkselection(shrinkByPixels);

Parameter Description
shrinkByPixels (Integer, Optional) Number of pixels to shrink

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.shrinkselection();

action.puttoimagebuffer(targetLocation) – Puts the current image to a specified buffer location

Description: Puts the current image to a specified buffer location.

Syntax: const result = await action.puttoimagebuffer(targetLocation);

Parameter Description
targetLocation (Integer, Optional) Buffer location index

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.puttoimagebuffer();

action.getfromimagebuffer(sourceLocation) – Retrieves an image from a specified buffer location

Description: Retrieves an image from a specified buffer location.

Syntax: const result = await action.getfromimagebuffer(sourceLocation);

Parameter Description
sourceLocation (Integer, Optional) Buffer location index

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.getfromimagebuffer();

action.copy() – Copies the current selection to the clipboard

Description: Copies the current selection to the clipboard.

Syntax: const result = await action.copy();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.copy();

action.paste() – Pastes the contents of the clipboard into the workspace

Description: Pastes the contents of the clipboard into the workspace.

Syntax: const result = await action.paste();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.paste();

action.unselect() – Clears the active selection

Description: Clears the active selection.

Syntax: const result = await action.unselect();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.unselect();

Image Transforms & Filters

action.boxaveraging(kernelSize) – Applies a box averaging blur filter

Description: Applies a box averaging blur filter.

Syntax: const result = await action.boxaveraging(kernelSize);

Parameter Description
kernelSize (Integer, Optional) Size of the filter kernel

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.boxaveraging();

action.gaussianfilter(kernelSize) – Applies a Gaussian blur filter

Description: Applies a Gaussian blur filter.

Syntax: const result = await action.gaussianfilter(kernelSize);

Parameter Description
kernelSize (Integer, Optional) Size of the Gaussian kernel

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.gaussianfilter();

action.flipvertically() – Flips the image vertically

Description: Flips the image vertically.

Syntax: const result = await action.flipvertically();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.flipvertically();

action.fliphorizontally() – Flips the image horizontally

Description: Flips the image horizontally.

Syntax: const result = await action.fliphorizontally();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.fliphorizontally();

action.sharpen3x3() – Applies a basic 3×3 sharpening filter

Description: Applies a basic 3×3 sharpening filter.

Syntax: const result = await action.sharpen3x3();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.sharpen3x3();

action.sharpen5x5highquality(sharpenStrengthPercentage) – Applies a high-quality 5×5 sharpening filter

Description: Applies a high-quality 5×5 sharpening filter.

Syntax: const result = await action.sharpen5x5highquality(sharpenStrengthPercentage);

Parameter Description
sharpenStrengthPercentage (Integer, Optional) Strength of sharpening (percentage)

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.sharpen5x5highquality();

action.advancedsharpening(sharpenAmountPercentage) – Applies an advanced sharpening algorithm

Description: Applies an advanced sharpening algorithm.

Syntax: const result = await action.advancedsharpening(sharpenAmountPercentage);

Parameter Description
sharpenAmountPercentage (Integer, Optional) Amount of sharpening (percentage)

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.advancedsharpening();

action.smartdenoise(radius, threshold) – Reduces noise in the image while preserving edges

Description: Reduces noise in the image while preserving edges.

Syntax: const result = await action.smartdenoise(radius, threshold);

Parameter Description
radius (Integer, Optional) Radius for noise reduction
threshold (Integer, Optional) Threshold for noise detection

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.smartdenoise();

action.emboss(angle, distance, strength, bias) – Applies an embossing effect to the image

Description: Applies an embossing effect to the image.

Syntax: const result = await action.emboss(angle, distance, strength, bias);

Parameter Description
angle (Single, Optional) Lighting angle
distance (Integer, Optional) Emboss depth/distance
strength (Integer, Optional) Effect strength
bias (Integer, Optional) Color bias

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.emboss();

action.dithering(ditheringAlgorithmType) – Applies a dithering algorithm to reduce color banding

Description: Applies a dithering algorithm to reduce color banding.

Syntax: const result = await action.dithering(ditheringAlgorithmType);

Parameter Description
ditheringAlgorithmType (Integer, Optional) Type of dithering algorithm

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.dithering();

action.mosaicfilter(mosaicModeType, value) – Applies a mosaic/pixelation filter to the image

Description: Applies a mosaic/pixelation filter to the image.

Syntax: const result = await action.mosaicfilter(mosaicModeType, value);

Parameter Description
mosaicModeType (Integer, Optional) Mosaic mode selection
value (Integer, Optional) Block size or intensity

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.mosaicfilter();

action.rotationalalignmentbyline(backgroundColorRed, backgroundColorGreen, backgroundColorBlue) – Automatically aligns rotation based on detected lines

Description: Automatically aligns rotation based on detected lines.

Syntax: const result = await action.rotationalalignmentbyline(backgroundColorRed, backgroundColorGreen, backgroundColorBlue);

Parameter Description
backgroundColorRed (Integer, Optional) Red component of background (0-255)
backgroundColorGreen (Integer, Optional) Green component of background (0-255)
backgroundColorBlue (Integer, Optional) Blue component of background (0-255)

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.rotationalalignmentbyline();

action.resize(resizeUnitType, maintainAspectRatio, baseDimensionType, targetWidth, targetHeight, interpolationAlgorithmType) – Resizes the image using specified dimensions and interpolation

Description: Resizes the image using specified dimensions and interpolation.

Syntax: const result = await action.resize(resizeUnitType, maintainAspectRatio, baseDimensionType, targetWidth, targetHeight, interpolationAlgorithmType);

Parameter Description
resizeUnitType (Integer, Optional) Unit of measurement for resize
maintainAspectRatio (Boolean, Optional) Keep original aspect ratio
baseDimensionType (Integer, Optional) Dimension to base aspect ratio on
targetWidth (Integer, Optional) Target width
targetHeight (Integer, Optional) Target height
interpolationAlgorithmType (Integer, Optional) Algorithm for resampling

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.resize();

action.rotate(rotationAngleDegrees, rotationDirectionType, backgroundColorRed, backgroundColorGreen, backgroundColorBlue) – Rotates the image by a specific angle

Description: Rotates the image by a specific angle.

Syntax: const result = await action.rotate(rotationAngleDegrees, rotationDirectionType, backgroundColorRed, backgroundColorGreen, backgroundColorBlue);

Parameter Description
rotationAngleDegrees (Single, Optional) Angle in degrees
rotationDirectionType (Integer, Optional) Direction of rotation (e.g., CW/CCW)
backgroundColorRed (Integer, Optional) Red component of fill color
backgroundColorGreen (Integer, Optional) Green component of fill color
backgroundColorBlue (Integer, Optional) Blue component of fill color

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.rotate();

action.crop(cropWidthPixels, cropHeightPixels, startXCoordinate, startYCoordinate) – Crops the image to a defined rectangle

Description: Crops the image to a defined rectangle.

Syntax: const result = await action.crop(cropWidthPixels, cropHeightPixels, startXCoordinate, startYCoordinate);

Parameter Description
cropWidthPixels (Integer, Optional) Width of cropped area
cropHeightPixels (Integer, Optional) Height of cropped area
startXCoordinate (Integer, Optional) Starting X coordinate
startYCoordinate (Integer, Optional) Starting Y coordinate

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.crop();

action.resizecanvas(resizeUnitType, maintainAspectRatio, baseDimensionType, targetWidth, targetHeight, canvasAlignmentType, backgroundColorRed, backgroundColorGreen, backgroundColorBlue) – Resizes the canvas without scaling the image content

Description: Resizes the canvas without scaling the image content.

Syntax: const result = await action.resizecanvas(resizeUnitType, maintainAspectRatio, baseDimensionType, targetWidth, targetHeight, canvasAlignmentType, backgroundColorRed, backgroundColorGreen, backgroundColorBlue);

Parameter Description
resizeUnitType (Integer, Optional) Unit of measurement
maintainAspectRatio (Boolean, Optional) Keep aspect ratio for canvas
baseDimensionType (Integer, Optional) Base dimension for aspect ratio
targetWidth (Integer, Optional) Target canvas width
targetHeight (Integer, Optional) Target canvas height
canvasAlignmentType (Integer, Optional) Alignment of original image
backgroundColorRed (Integer, Optional) Background red value
backgroundColorGreen (Integer, Optional) Background green value
backgroundColorBlue (Integer, Optional) Background blue value

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.resizecanvas();

action.overlayimage(sourceLocation1, sourceLocation2, targetColorRed, targetColorGreen, targetColorBlue, opacity, enableFeathering, featheringRadius) – Overlays one image on top of another with opacity and feathering controls

Description: Overlays one image on top of another with opacity and feathering controls.

Syntax: const result = await action.overlayimage(sourceLocation1, sourceLocation2, targetColorRed, targetColorGreen, targetColorBlue, opacity, enableFeathering, featheringRadius);

Parameter Description
sourceLocation1 (Integer, Optional) First image source location
sourceLocation2 (Integer, Optional) Second image source location
targetColorRed (Integer, Optional) Target transparent color Red
targetColorGreen (Integer, Optional) Target transparent color Green
targetColorBlue (Integer, Optional) Target transparent color Blue
opacity (Integer, Optional) Overlay opacity percentage
enableFeathering (Boolean, Optional) Enable edge feathering
featheringRadius (Integer, Optional) Feathering blur radius

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.overlayimage();

action.chromakeyoverlay(sourceLocation1, targetColorRed, targetColorGreen, targetColorBlue, sourceLocation2, opacity, enableFeathering, featheringRadius) – Applies a chroma key effect to blend two images based on a target color

Description: Applies a chroma key effect to blend two images based on a target color.

Syntax: const result = await action.chromakeyoverlay(sourceLocation1, targetColorRed, targetColorGreen, targetColorBlue, sourceLocation2, opacity, enableFeathering, featheringRadius);

Parameter Description
sourceLocation1 (Integer, Optional) Foreground image location
targetColorRed (Integer, Optional) Chroma key color Red
targetColorGreen (Integer, Optional) Chroma key color Green
targetColorBlue (Integer, Optional) Chroma key color Blue
sourceLocation2 (Integer, Optional) Background image location
opacity (Integer, Optional) Overlay opacity percentage
enableFeathering (Boolean, Optional) Enable edge feathering
featheringRadius (Integer, Optional) Feathering blur radius

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.chromakeyoverlay();

Color & Channel Actions

action.splitrgb(rgbSplitChannelType) – Splits the image and keeps the specified RGB channel

Description: Splits the image and keeps the specified RGB channel.

Syntax: const result = await action.splitrgb(rgbSplitChannelType);

Parameter Description
rgbSplitChannelType (Integer, Optional) RGB channel to isolate

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.splitrgb();

action.deletechannel(channelToDeleteType) – Removes a specific color channel from the image

Description: Removes a specific color channel from the image.

Syntax: const result = await action.deletechannel(channelToDeleteType);

Parameter Description
channelToDeleteType (Integer, Optional) Color channel to remove

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.deletechannel();

action.grayfrom(sourceChannelType) – Creates a grayscale image based on a specific color channel

Description: Creates a grayscale image based on a specific color channel.

Syntax: const result = await action.grayfrom(sourceChannelType);

Parameter Description
sourceChannelType (Integer, Optional) Source color channel

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.grayfrom();

action.invert() – Inverts the colors of the image

Description: Inverts the colors of the image.

Syntax: const result = await action.invert();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.invert();

action.grayscaling() – Converts the image to standard grayscale

Description: Converts the image to standard grayscale.

Syntax: const result = await action.grayscaling();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.grayscaling();

action.converttorgchrom() – Converts the image to rg chromaticity space

Description: Converts the image to rg chromaticity space.

Syntax: const result = await action.converttorgchrom();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.converttorgchrom();

action.graytocolor(mapType, isReversed) – Applies a pseudocolor map to a grayscale image

Description: Applies a pseudocolor map to a grayscale image.

Syntax: const result = await action.graytocolor(mapType, isReversed);

Parameter Description
mapType (Integer, Optional) Type of color map
isReversed (Boolean, Optional) Reverse the color map

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.graytocolor();

action.autotone(clipPercentage) – Automatically adjusts the tonal range of the image

Description: Automatically adjusts the tonal range of the image.

Syntax: const result = await action.autotone(clipPercentage);

Parameter Description
clipPercentage (Single, Optional) Percentage of pixels to clip

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.autotone();

action.autocontrast(clipPercentage) – Automatically adjusts the contrast of the image

Description: Automatically adjusts the contrast of the image.

Syntax: const result = await action.autocontrast(clipPercentage);

Parameter Description
clipPercentage (Single, Optional) Percentage of pixels to clip

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.autocontrast();

action.autoequalize() – Applies automatic histogram equalization

Description: Applies automatic histogram equalization.

Syntax: const result = await action.autoequalize();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.autoequalize();

action.autogamma() – Automatically corrects the gamma curve of the image

Description: Automatically corrects the gamma curve of the image.

Syntax: const result = await action.autogamma();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.autogamma();

action.autowhitebalance() – Automatically adjusts the white balance to correct color casts

Description: Automatically adjusts the white balance to correct color casts.

Syntax: const result = await action.autowhitebalance();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.autowhitebalance();

action.autoshadowshighlights(shadowCorrectionStrengthPercentage, highlightCorrectionStrengthPercentage) – Adjusts shadow and highlight details automatically

Description: Adjusts shadow and highlight details automatically.

Syntax: const result = await action.autoshadowshighlights(shadowCorrectionStrengthPercentage, highlightCorrectionStrengthPercentage);

Parameter Description
shadowCorrectionStrengthPercentage (Single, Optional) Strength of shadow recovery
highlightCorrectionStrengthPercentage (Single, Optional) Strength of highlight recovery

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.autoshadowshighlights();

action.adaptivecontrast(contrastStrengthPercentage, gridTilesX, gridTilesY, contrastClipLimit) – Applies local adaptive contrast enhancement

Description: Applies local adaptive contrast enhancement.

Syntax: const result = await action.adaptivecontrast(contrastStrengthPercentage, gridTilesX, gridTilesY, contrastClipLimit);

Parameter Description
contrastStrengthPercentage (Integer, Optional) Enhancement strength
gridTilesX (Integer, Optional) Number of horizontal grid tiles
gridTilesY (Integer, Optional) Number of vertical grid tiles
contrastClipLimit (Single, Optional) Limit for contrast clipping

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.adaptivecontrast();

action.correctunevenillumination(illuminationGridSize) – Corrects uneven background illumination

Description: Corrects uneven background illumination.

Syntax: const result = await action.correctunevenillumination(illuminationGridSize);

Parameter Description
illuminationGridSize (Integer, Optional) Grid size for illumination estimation

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.correctunevenillumination();

action.rollingballbackgroundsubtraction(rollingBallBoxSize, isObjectColorAutomatic, manualObjectColorType) – Subtracts background using a rolling ball algorithm

Description: Subtracts background using a rolling ball algorithm.

Syntax: const result = await action.rollingballbackgroundsubtraction(rollingBallBoxSize, isObjectColorAutomatic, manualObjectColorType);

Parameter Description
rollingBallBoxSize (Integer, Optional) Radius of rolling ball
isObjectColorAutomatic (Boolean, Optional) Automatically detect object color
manualObjectColorType (Integer, Optional) Manual object color mode

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.rollingballbackgroundsubtraction();

action.brightcontrast(brightnessLevel, contrastLevel, autoBrightness) – Adjusts brightness and contrast levels manually or automatically

Description: Adjusts brightness and contrast levels manually or automatically.

Syntax: const result = await action.brightcontrast(brightnessLevel, contrastLevel, autoBrightness);

Parameter Description
brightnessLevel (Integer, Optional) Brightness adjustment value
contrastLevel (Integer, Optional) Contrast adjustment value
autoBrightness (Boolean, Optional) Enable automatic brightness

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.brightcontrast();

action.changecolor(sourceColorRed, sourceColorGreen, sourceColorBlue, targetColorRed, targetColorGreen, targetColorBlue) – Replaces a specific source color with a target color

Description: Replaces a specific source color with a target color.

Syntax: const result = await action.changecolor(sourceColorRed, sourceColorGreen, sourceColorBlue, targetColorRed, targetColorGreen, targetColorBlue);

Parameter Description
sourceColorRed (Integer, Optional) Source color Red
sourceColorGreen (Integer, Optional) Source color Green
sourceColorBlue (Integer, Optional) Source color Blue
targetColorRed (Integer, Optional) Target color Red
targetColorGreen (Integer, Optional) Target color Green
targetColorBlue (Integer, Optional) Target color Blue

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.changecolor();

action.cielab(lightnessShift, aAxisShift, bAxisShift) – Adjusts colors in the CIE L*a*b* color space

Description: Adjusts colors in the CIE L*a*b* color space.

Syntax: const result = await action.cielab(lightnessShift, aAxisShift, bAxisShift);

Parameter Description
lightnessShift (Integer, Optional) Shift in Lightness (L)
aAxisShift (Integer, Optional) Shift in Green-Red axis (a)
bAxisShift (Integer, Optional) Shift in Blue-Yellow axis (b)

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.cielab();

action.multibandcolor(rSat, rInt, ySat, yInt, gSat, gInt, cyanSat, cyanInt, bSat, bInt, mSat, mInt) – Adjusts saturation and intensity across multiple color bands

Description: Adjusts saturation and intensity across multiple color bands.

Syntax: const result = await action.multibandcolor(rSat, rInt, ySat, yInt, gSat, gInt, cyanSat, cyanInt, bSat, bInt, mSat, mInt);

Parameter Description
rSat (Integer, Optional) Red saturation
rInt (Integer, Optional) Red intensity
ySat (Integer, Optional) Yellow saturation
yInt (Integer, Optional) Yellow intensity
gSat (Integer, Optional) Green saturation
gInt (Integer, Optional) Green intensity
cyanSat (Integer, Optional) Cyan saturation
cyanInt (Integer, Optional) Cyan intensity
bSat (Integer, Optional) Blue saturation
bInt (Integer, Optional) Blue intensity
mSat (Integer, Optional) Magenta saturation
mInt (Integer, Optional) Magenta intensity

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.multibandcolor();

action.huesaturationintensity(hue, saturation, intensity) – Adjusts global hue, saturation, and intensity

Description: Adjusts global hue, saturation, and intensity.

Syntax: const result = await action.huesaturationintensity(hue, saturation, intensity);

Parameter Description
hue (Integer, Optional) Hue adjustment
saturation (Integer, Optional) Saturation adjustment
intensity (Integer, Optional) Intensity adjustment

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.huesaturationintensity();

action.mergechannels(colorSpaceType, image1Source, image2Source, image3Source) – Merges separate image sources into a single color space representation

Description: Merges separate image sources into a single color space representation.

Syntax: const result = await action.mergechannels(colorSpaceType, image1Source, image2Source, image3Source);

Parameter Description
colorSpaceType (Integer, Optional) Target color space
image1Source (Integer, Optional) Source index for channel 1
image2Source (Integer, Optional) Source index for channel 2
image3Source (Integer, Optional) Source index for channel 3

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.mergechannels();

Processing & Morphological Actions

action.fillregion(fillRegionType, fillColorRed, fillColorGreen, fillColorBlue, fillOpacityPercentage) – Fills a specified region with color and opacity

Description: Fills a specified region with color and opacity.

Syntax: const result = await action.fillregion(fillRegionType, fillColorRed, fillColorGreen, fillColorBlue, fillOpacityPercentage);

Parameter Description
fillRegionType (Integer, Optional) Type of region to fill
fillColorRed (Integer, Optional) Fill color Red component
fillColorGreen (Integer, Optional) Fill color Green component
fillColorBlue (Integer, Optional) Fill color Blue component
fillOpacityPercentage (Integer, Optional) Opacity percentage

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.fillregion();

action.drawselectionborder(borderColorRed, borderColorGreen, borderColorBlue, borderThicknessPixels, borderOpacityPercentage, applyToMultipleROIs) – Draws a border around the current selection

Description: Draws a border around the current selection.

Syntax: const result = await action.drawselectionborder(borderColorRed, borderColorGreen, borderColorBlue, borderThicknessPixels, borderOpacityPercentage, applyToMultipleROIs);

Parameter Description
borderColorRed (Integer, Optional) Border color Red
borderColorGreen (Integer, Optional) Border color Green
borderColorBlue (Integer, Optional) Border color Blue
borderThicknessPixels (Integer, Optional) Thickness of the border
borderOpacityPercentage (Integer, Optional) Opacity of the border
applyToMultipleROIs (Boolean, Optional) Apply to multiple Regions of Interest

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.drawselectionborder();

action.hideoutlines(targetColorRed, targetColorGreen, targetColorBlue, useMostFrequentColor) – Hides drawn outlines by blending them with a target color or most frequent color

Description: Hides drawn outlines by blending them with a target color or most frequent color.

Syntax: const result = await action.hideoutlines(targetColorRed, targetColorGreen, targetColorBlue, useMostFrequentColor);

Parameter Description
targetColorRed (Integer, Optional) Target color Red
targetColorGreen (Integer, Optional) Target color Green
targetColorBlue (Integer, Optional) Target color Blue
useMostFrequentColor (Boolean, Optional) Use most frequent color automatically

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.hideoutlines();

action.changenonblacktowhite() – Converts all non-black pixels in the image to white

Description: Converts all non-black pixels in the image to white.

Syntax: const result = await action.changenonblacktowhite();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.changenonblacktowhite();

action.erode(morphologyKernelSize) – Applies morphological erosion

Description: Applies morphological erosion.

Syntax: const result = await action.erode(morphologyKernelSize);

Parameter Description
morphologyKernelSize (Integer, Optional) Size of morphology kernel

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.erode();

action.dilate(morphologyKernelSize) – Applies morphological dilation

Description: Applies morphological dilation.

Syntax: const result = await action.dilate(morphologyKernelSize);

Parameter Description
morphologyKernelSize (Integer, Optional) Size of morphology kernel

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.dilate();

action.edgedetection(edgeDetectionAlgorithmType) – Detects edges using specified standard algorithms

Description: Detects edges using specified standard algorithms.

Syntax: const result = await action.edgedetection(edgeDetectionAlgorithmType);

Parameter Description
edgeDetectionAlgorithmType (Integer, Optional) Edge detection algorithm mode

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.edgedetection();

action.cannyedge(cannyHighThreshold) – Detects edges using the Canny edge detection method

Description: Detects edges using the Canny edge detection method.

Syntax: const result = await action.cannyedge(cannyHighThreshold);

Parameter Description
cannyHighThreshold (Integer, Optional) High threshold for Canny detection

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.cannyedge();

action.skeletonize() – Applies morphological skeletonization (thinning)

Description: Applies morphological skeletonization (thinning).

Syntax: const result = await action.skeletonize();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.skeletonize();

action.skeletonizeextended() – Applies extended morphological skeletonization

Description: Applies extended morphological skeletonization.

Syntax: const result = await action.skeletonizeextended();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.skeletonizeextended();

action.boundarydetection(boundaryOverlayModeType) – Detects boundaries of objects based on overlay modes

Description: Detects boundaries of objects based on overlay modes.

Syntax: const result = await action.boundarydetection(boundaryOverlayModeType);

Parameter Description
boundaryOverlayModeType (Integer, Optional) Mode for boundary processing

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.boundarydetection();

action.removeblackdots(maxDotSize) – Removes isolated black dots (noise) below a certain size

Description: Removes isolated black dots (noise) below a certain size.

Syntax: const result = await action.removeblackdots(maxDotSize);

Parameter Description
maxDotSize (Integer, Optional) Maximum size of dots to remove

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.removeblackdots();

action.removewhitedots(maxDotSize) – Removes isolated white dots (noise) below a certain size

Description: Removes isolated white dots (noise) below a certain size.

Syntax: const result = await action.removewhitedots(maxDotSize);

Parameter Description
maxDotSize (Integer, Optional) Maximum size of dots to remove

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.removewhitedots();

action.outline() – Extracts the outlines of binary objects

Description: Extracts the outlines of binary objects.

Syntax: const result = await action.outline();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.outline();

action.erodeoutline() – Erodes only the outlined regions

Description: Erodes only the outlined regions.

Syntax: const result = await action.erodeoutline();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.erodeoutline();

action.dilateoutline() – Dilates only the outlined regions

Description: Dilates only the outlined regions.

Syntax: const result = await action.dilateoutline();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.dilateoutline();

action.manualthresholding(binarizationThresholdValue) – Applies binarization using a manually defined threshold

Description: Applies binarization using a manually defined threshold.

Syntax: const result = await action.manualthresholding(binarizationThresholdValue);

Parameter Description
binarizationThresholdValue (Integer, Optional) Threshold value (0-255)

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.manualthresholding();

action.multistepthresholding(redChannelLevels, greenChannelLevels, blueChannelLevels) – Applies multi-level thresholding across RGB channels

Description: Applies multi-level thresholding across RGB channels.

Syntax: const result = await action.multistepthresholding(redChannelLevels, greenChannelLevels, blueChannelLevels);

Parameter Description
redChannelLevels (Integer, Optional) Levels for Red channel
greenChannelLevels (Integer, Optional) Levels for Green channel
blueChannelLevels (Integer, Optional) Levels for Blue channel

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.multistepthresholding();

action.differentialimage(firstImageSourceLocation, secondImageSourceLocation) – Calculates the difference between two images

Description: Calculates the difference between two images.

Syntax: const result = await action.differentialimage(firstImageSourceLocation, secondImageSourceLocation);

Parameter Description
firstImageSourceLocation (Integer, Optional) Source index for first image
secondImageSourceLocation (Integer, Optional) Source index for second image

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.differentialimage();

action.watershedsegmentation(minDistanceThreshold, smoothingRadius, boundaryThickness, boundaryColorRed, boundaryColorGreen, boundaryColorBlue) – Applies watershed segmentation algorithm

Description: Applies watershed segmentation algorithm.

Syntax: const result = await action.watershedsegmentation(minDistanceThreshold, smoothingRadius, boundaryThickness, boundaryColorRed, boundaryColorGreen, boundaryColorBlue);

Parameter Description
minDistanceThreshold (Integer, Optional) Minimum distance between peaks
smoothingRadius (Integer, Optional) Radius for initial smoothing
boundaryThickness (Integer, Optional) Thickness of detected boundaries
boundaryColorRed (Integer, Optional) Boundary color Red
boundaryColorGreen (Integer, Optional) Boundary color Green
boundaryColorBlue (Integer, Optional) Boundary color Blue

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.watershedsegmentation();

action.binaryoperation(logicalOperationType, firstImageSourceLocation, secondImageSourceLocation) – Performs logical operations between two binary images

Description: Performs logical operations between two binary images.

Syntax: const result = await action.binaryoperation(logicalOperationType, firstImageSourceLocation, secondImageSourceLocation);

Parameter Description
logicalOperationType (Integer, Optional) Type of logical operation (AND, OR, etc)
firstImageSourceLocation (Integer, Optional) First image source index
secondImageSourceLocation (Integer, Optional) Second image source index

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.binaryoperation();

action.adaptivethresholding(adaptiveBoxSize, adaptiveThresholdLevel, isObjectColorAutomatic, manualObjectColorType) – Applies local adaptive thresholding for binarization

Description: Applies local adaptive thresholding for binarization.

Syntax: const result = await action.adaptivethresholding(adaptiveBoxSize, adaptiveThresholdLevel, isObjectColorAutomatic, manualObjectColorType);

Parameter Description
adaptiveBoxSize (Integer, Optional) Box size for adaptive calculation
adaptiveThresholdLevel (Integer, Optional) Threshold tuning level
isObjectColorAutomatic (Boolean, Optional) Auto detect object color
manualObjectColorType (Integer, Optional) Manual object color mode

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.adaptivethresholding();

action.regioncoloring(connectivity) – Colors separated contiguous regions differently

Description: Colors separated contiguous regions differently.

Syntax: const result = await action.regioncoloring(connectivity);

Parameter Description
connectivity (Integer, Optional) Pixel connectivity (4 or 8)

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.regioncoloring();

action.superpixelsegmentation(numSuperpixels, compactness, fillWithWhite) – Segments the image into superpixels

Description: Segments the image into superpixels.

Syntax: const result = await action.superpixelsegmentation(numSuperpixels, compactness, fillWithWhite);

Parameter Description
numSuperpixels (Integer, Optional) Desired number of superpixels
compactness (Single, Optional) Compactness factor
fillWithWhite (Boolean, Optional) Fill boundaries with white

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.superpixelsegmentation();

Hardware & Capture Actions

action.capture() – Triggers hardware capture mechanism

Description: Triggers hardware capture mechanism.

Syntax: const result = await action.capture();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.capture();

action.acquireimagefromscanner(useSilentMode) – Acquires an image from a connected scanner hardware

Description: Acquires an image from a connected scanner hardware.

Syntax: const result = await action.acquireimagefromscanner(useSilentMode);

Parameter Description
useSilentMode (Boolean, Optional) Operate without showing scanner UI

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.acquireimagefromscanner();

Neural & AI Processing Actions

action.aidepthestimation(autoResizeLargeImages) – Estimates depth maps using AI

Description: Estimates depth maps using AI.

Syntax: const result = await action.aidepthestimation(autoResizeLargeImages);

Parameter Description
autoResizeLargeImages (Boolean, Optional) Automatically resize large inputs

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aidepthestimation();

action.aidocumentunwarping() – Unwarps distorted document images using AI

Description: Unwarps distorted document images using AI.

Syntax: const result = await action.aidocumentunwarping();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aidocumentunwarping();

action.aibinarizationsegmentation() – Segments text or structures via AI-based binarization

Description: Segments text or structures via AI-based binarization.

Syntax: const result = await action.aibinarizationsegmentation();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aibinarizationsegmentation();

action.aiinpainting() – Inpaints missing or masked areas via AI

Description: Inpaints missing or masked areas via AI.

Syntax: const result = await action.aiinpainting();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiinpainting();

action.aibackgroundremovalselfie(virtualBackgroundColorRed, virtualBackgroundColorGreen, virtualBackgroundColorBlue) – Removes backgrounds in selfie images and replaces with a color

Description: Removes backgrounds in selfie images and replaces with a color.

Syntax: const result = await action.aibackgroundremovalselfie(virtualBackgroundColorRed, virtualBackgroundColorGreen, virtualBackgroundColorBlue);

Parameter Description
virtualBackgroundColorRed (Integer, Optional) Virtual background Red
virtualBackgroundColorGreen (Integer, Optional) Virtual background Green
virtualBackgroundColorBlue (Integer, Optional) Virtual background Blue

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aibackgroundremovalselfie();

action.aiimagesharpening(sharpenBoostFactor) – Sharpens images utilizing an AI model

Description: Sharpens images utilizing an AI model.

Syntax: const result = await action.aiimagesharpening(sharpenBoostFactor);

Parameter Description
sharpenBoostFactor (Single, Optional) Sharpening intensity factor

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiimagesharpening();

action.aiimagequalityrestorationfast(restorationBoostFactor) – Fast AI-based image quality restoration

Description: Fast AI-based image quality restoration.

Syntax: const result = await action.aiimagequalityrestorationfast(restorationBoostFactor);

Parameter Description
restorationBoostFactor (Single, Optional) Restoration boost multiplier

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiimagequalityrestorationfast();

action.aiimagequalityrestorationslow() – Standard AI-based image quality restoration (slower)

Description: Standard AI-based image quality restoration (slower).

Syntax: const result = await action.aiimagequalityrestorationslow();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiimagequalityrestorationslow();

action.aiimagequalityrestorationslowest() – High-quality, very slow AI-based restoration

Description: High-quality, very slow AI-based restoration.

Syntax: const result = await action.aiimagequalityrestorationslowest();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiimagequalityrestorationslowest();

action.aiimagequalityrestorationfastest() – Lowest-quality, extremely fast AI-based restoration

Description: Lowest-quality, extremely fast AI-based restoration.

Syntax: const result = await action.aiimagequalityrestorationfastest();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiimagequalityrestorationfastest();

action.aibackgroundremovalgeneral(virtualBackgroundColorRed, virtualBackgroundColorGreen, virtualBackgroundColorBlue) – General purpose AI background removal

Description: General purpose AI background removal.

Syntax: const result = await action.aibackgroundremovalgeneral(virtualBackgroundColorRed, virtualBackgroundColorGreen, virtualBackgroundColorBlue);

Parameter Description
virtualBackgroundColorRed (Integer, Optional) Virtual background Red
virtualBackgroundColorGreen (Integer, Optional) Virtual background Green
virtualBackgroundColorBlue (Integer, Optional) Virtual background Blue

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aibackgroundremovalgeneral();

action.aibackgroundremovalportrait(virtualBackgroundColorRed, virtualBackgroundColorGreen, virtualBackgroundColorBlue) – Portrait-optimized AI background removal

Description: Portrait-optimized AI background removal.

Syntax: const result = await action.aibackgroundremovalportrait(virtualBackgroundColorRed, virtualBackgroundColorGreen, virtualBackgroundColorBlue);

Parameter Description
virtualBackgroundColorRed (Integer, Optional) Virtual background Red
virtualBackgroundColorGreen (Integer, Optional) Virtual background Green
virtualBackgroundColorBlue (Integer, Optional) Virtual background Blue

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aibackgroundremovalportrait();

action.aismartselection() – Selects main subjects intelligently using AI

Description: Selects main subjects intelligently using AI.

Syntax: const result = await action.aismartselection();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aismartselection();

action.aiautosubjectselectiongeneral() – Automatically outlines general subjects

Description: Automatically outlines general subjects.

Syntax: const result = await action.aiautosubjectselectiongeneral();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiautosubjectselectiongeneral();

action.aiautosubjectselectionportrait() – Automatically outlines portrait subjects

Description: Automatically outlines portrait subjects.

Syntax: const result = await action.aiautosubjectselectionportrait();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiautosubjectselectionportrait();

action.aiimageupscalerealesrgan(upscaleMagnificationType) – Upscales images using Real-ESRGAN

Description: Upscales images using Real-ESRGAN.

Syntax: const result = await action.aiimageupscalerealesrgan(upscaleMagnificationType);

Parameter Description
upscaleMagnificationType (Integer, Optional) Scale factor multiplier

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiimageupscalerealesrgan();

action.aiimageupscalerealesrfast() – Upscales images rapidly using a faster Real-ESR model

Description: Upscales images rapidly using a faster Real-ESR model.

Syntax: const result = await action.aiimageupscalerealesrfast();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.aiimageupscalerealesrfast();

Data Extraction & Analysis Actions

action.averagecolorvalue(analysisTargetChannelType) – Calculates and returns the average color data from a specific channel

Description: Calculates and returns the average color data from a specific channel.

Syntax: const result = await action.averagecolorvalue(analysisTargetChannelType);

Parameter Description
analysisTargetChannelType (Integer, Optional) Target channel to analyze

Return Value: String

JavaScript (Node.js / Browser) Example:

let val; = action.averagecolorvalue();

action.pixelcounter(targetColorRed, targetColorGreen, targetColorBlue, resultOutputFormatType) – Counts pixels matching a specific color threshold

Description: Counts pixels matching a specific color threshold.

Syntax: const result = await action.pixelcounter(targetColorRed, targetColorGreen, targetColorBlue, resultOutputFormatType);

Parameter Description
targetColorRed (Integer, Optional) Target Red value
targetColorGreen (Integer, Optional) Target Green value
targetColorBlue (Integer, Optional) Target Blue value
resultOutputFormatType (Integer, Optional) Output formatting scheme

Return Value: String

JavaScript (Node.js / Browser) Example:

let result; = action.pixelcounter();

action.multicellanalysis(gridColumnsX, gridRowsY, cellShapeType, cellDiameterPixels, analysisModeType, analysisTargetChannelType, targetColorPresetName) – Performs grid-based cell counting or intensity analysis

Description: Performs grid-based cell counting or intensity analysis.

Syntax: const result = await action.multicellanalysis(gridColumnsX, gridRowsY, cellShapeType, cellDiameterPixels, analysisModeType, analysisTargetChannelType, targetColorPresetName);

Parameter Description
gridColumnsX (Integer, Optional) Number of grid columns
gridRowsY (Integer, Optional) Number of grid rows
cellShapeType (Integer, Optional) Shape classification of cell
cellDiameterPixels (Integer, Optional) Cell diameter in pixels
analysisModeType (Integer, Optional) Mode of calculation
analysisTargetChannelType (Integer, Optional) Target channel for analysis
targetColorPresetName (String, Optional) Named color preset

Return Value: String

JavaScript (Node.js / Browser) Example:

let result; = action.multicellanalysis();

action.ocrtextextraction() – Extracts text from the image using OCR (Optical Character Recognition)

Description: Extracts text from the image using OCR (Optical Character Recognition).

Syntax: const result = await action.ocrtextextraction();

Parameters: None

Return Value: String

JavaScript (Node.js / Browser) Example:

let textData; = action.ocrtextextraction();

Image Transfer Functions between Script Engine and PhenoCapture

action.getimage(sourceLocation) – Retrieves an image from the workspace or buffer array to the script engine

Description: Retrieves an image from the workspace or buffer array to the script engine.

Syntax: const result = await action.getimage(sourceLocation);

Parameter Description
sourceLocation (Integer, Optional) Image location index (0 = workspace)

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let myImg; = action.getimage();

action.setimage(newImage, targetLocation) – Sends an image from the script engine to the workspace or buffer array

Description: Sends an image from the script engine to the workspace or buffer array.

Syntax: const result = await action.setimage(newImage, targetLocation);

Parameter Description
newImage (Bitmap) Source bitmap to send
targetLocation (Integer, Optional) Target destination index (0 = workspace)

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let success; = action.setimage();

2. imgproc Object (ScriptImgProcHelper)

The ImgProc object provides core image processing, segmentation, color space manipulation, filtering, and pixel-level matrix transformation capabilities in PhenoCapture.

Core Image & Buffer Pipeline

imgproc.cloneimage(SourceImage) – Creates a deep copy duplicate of the source bitmap image

Description: Creates a deep copy duplicate of the source bitmap image.

Syntax: const result = await imgproc.cloneimage(SourceImage);

Parameter Description
SourceImage (Bitmap) Source bitmap image

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let copyBmp; As Bitmap = imgproc.cloneimage();

imgproc.removetransparency(SourceImage) – Removes alpha transparency channel from a bitmap, rendering it fully opaque

Description: Removes alpha transparency channel from a bitmap, rendering it fully opaque.

Syntax: const result = await imgproc.removetransparency(SourceImage);

Parameter Description
SourceImage (Bitmap) Source image with potential transparency

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let nonTransBmp; As Bitmap = imgproc.removetransparency();

imgproc.generateCanvas(nWidth, nHeight, BackColor) – Creates a blank canvas bitmap of specified dimensions filled with a background color

Description: Creates a blank canvas bitmap of specified dimensions filled with a background color.

Syntax: const result = await imgproc.generateCanvas(nWidth, nHeight, BackColor);

Parameter Description
nWidth (Integer) Canvas width in pixels
nHeight (Integer) Canvas height in pixels
BackColor (Color) Background fill color

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let canvas; As Bitmap = imgproc.generateCanvas();

Segmentation & Region Extraction

imgproc.superpixelsegmentation(SourceImage, numSuperpixels, compactness, fillWithWhite, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Executes parallel superpixel segmentation (SLIC algorithm) on the source image

Description: Executes parallel superpixel segmentation (SLIC algorithm) on the source image.

Syntax: const result = await imgproc.superpixelsegmentation(SourceImage, numSuperpixels, compactness, fillWithWhite, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source image to segment
numSuperpixels (Integer, Optional) Target number of superpixels
compactness (Single, Optional) Superpixel compactness factor
fillWithWhite (Boolean, Optional) Whether to fill region background with white
MaskImage (Bitmap, Optional) Mask bitmap for ROI
MaskRegionBoundary (Rectangle, Optional) Bounding box of ROI mask
IsMaskAllRegionSelected (Boolean, Optional) Flag indicating full canvas processing

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let spImg; As Bitmap = imgproc.superpixelsegmentation();

imgproc.regionextractFloodfill4(SourceImage, LabelIDMap, RegionColorTable, BkColor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts connected regions using 4-connectivity flood fill algorithm and builds label ID maps

Description: Extracts connected regions using 4-connectivity flood fill algorithm and builds label ID maps.

Syntax: const result = await imgproc.regionextractFloodfill4(SourceImage, LabelIDMap, RegionColorTable, BkColor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
LabelIDMap (Integer(,)) ByRef output 2D array storing pixel region label IDs
RegionColorTable (Byte(,)) ByRef output 2D array storing color mapping per region
BkColor (Integer, Optional) Background color integer value
MaskImage (Bitmap, Optional) Mask bitmap
MaskRegionBoundary (Rectangle, Optional) Mask ROI boundary
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let idMap;(,) As Integer;
let colorTable;(,) As Byte;
let resBmp; = imgproc.regionextractFloodfill4();

imgproc.regionextractFloodfill8(SourceImage, LabelIDMap, RegionColorTable, BkColor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts connected regions using 8-connectivity flood fill algorithm and builds label ID maps

Description: Extracts connected regions using 8-connectivity flood fill algorithm and builds label ID maps.

Syntax: const result = await imgproc.regionextractFloodfill8(SourceImage, LabelIDMap, RegionColorTable, BkColor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
LabelIDMap (Integer(,)) ByRef output 2D array storing pixel region label IDs
RegionColorTable (Byte(,)) ByRef output 2D array storing color mapping per region
BkColor (Integer, Optional) Background color integer value
MaskImage (Bitmap, Optional) Mask bitmap
MaskRegionBoundary (Rectangle, Optional) Mask ROI boundary
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let idMap;(,) As Integer;
let colorTable;(,) As Byte;
let resBmp; = imgproc.regionextractFloodfill8();

imgproc.regionextractColorfloodfill4(SourceImage, LabelIDMap, RegionColorTable, BoundaryColor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts regions based on color boundaries using 4-connectivity flood fill

Description: Extracts regions based on color boundaries using 4-connectivity flood fill.

Syntax: const result = await imgproc.regionextractColorfloodfill4(SourceImage, LabelIDMap, RegionColorTable, BoundaryColor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
LabelIDMap (Integer(,)) ByRef output 2D array storing region label IDs
RegionColorTable (Byte(,)) ByRef output 2D array storing region colors
BoundaryColor (Integer, Optional) Boundary color integer value
MaskImage (Bitmap, Optional) Mask bitmap
MaskRegionBoundary (Rectangle, Optional) Mask ROI boundary
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let resBmp; = imgproc.regionextractColorfloodfill4();

imgproc.regionextractColorfloodfill8(SourceImage, LabelIDMap, RegionColorTable, BoundaryColor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts regions based on color boundaries using 8-connectivity flood fill

Description: Extracts regions based on color boundaries using 8-connectivity flood fill.

Syntax: const result = await imgproc.regionextractColorfloodfill8(SourceImage, LabelIDMap, RegionColorTable, BoundaryColor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
LabelIDMap (Integer(,)) ByRef output 2D array storing region label IDs
RegionColorTable (Byte(,)) ByRef output 2D array storing region colors
BoundaryColor (Integer, Optional) Boundary color integer value
MaskImage (Bitmap, Optional) Mask bitmap
MaskRegionBoundary (Rectangle, Optional) Mask ROI boundary
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let resBmp; = imgproc.regionextractColorfloodfill8();

Color Model & Channel Adjustments

imgproc.shadowshighlights(original, shadowAmt, highlightAmt, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Adjusts shadow and highlight exposure levels independently using multi-threaded parallel execution

Description: Adjusts shadow and highlight exposure levels independently using multi-threaded parallel execution.

Syntax: const result = await imgproc.shadowshighlights(original, shadowAmt, highlightAmt, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
original (Bitmap) Original input bitmap
shadowAmt (Single) Shadow adjustment amount (0.0 to 100.0)
highlightAmt (Single) Highlight adjustment amount (0.0 to 100.0)
MaskImage (Image, Optional) Optional mask image
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.shadowshighlights();

imgproc.multibandcolor(original, rSat, rInt, ySat, yInt, gSat, gInt, cSat, cyanInt, bSat, bInt, mSat, mInt, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Performs multi-band selective color adjustment across 6 primary color bands (RGB, CMY)

Description: Performs multi-band selective color adjustment across 6 primary color bands (RGB, CMY).

Syntax: const result = await imgproc.multibandcolor(original, rSat, rInt, ySat, yInt, gSat, gInt, cSat, cyanInt, bSat, bInt, mSat, mInt, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
original (Bitmap) Original bitmap image
rSat (Integer) Red saturation shift (-100 to 100)
rInt (Integer) Red intensity shift (-100 to 100)
ySat (Integer) Yellow saturation shift (-100 to 100)
yInt (Integer) Yellow intensity shift (-100 to 100)
gSat (Integer) Green saturation shift (-100 to 100)
gInt (Integer) Green intensity shift (-100 to 100)
cSat (Integer) Cyan saturation shift (-100 to 100)
cyanInt (Integer) Cyan intensity shift (-100 to 100)
bSat (Integer) Blue saturation shift (-100 to 100)
bInt (Integer) Blue intensity shift (-100 to 100)
mSat (Integer) Magenta saturation shift (-100 to 100)
mInt (Integer) Magenta intensity shift (-100 to 100)
MaskImage (Image, Optional) Optional mask image
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.multibandcolor();

imgproc.cielab(original, lShift, aShift, bShift, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Adjusts Lightness (L) and chromaticity channels (a, b) in CIELAB color space

Description: Adjusts Lightness (L) and chromaticity channels (a, b) in CIELAB color space.

Syntax: const result = await imgproc.cielab(original, lShift, aShift, bShift, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
original (Bitmap) Original input image
lShift (Integer) Lightness shift (-127 to 127)
aShift (Integer) Green-Red axis shift (-127 to 127)
bShift (Integer) Blue-Yellow axis shift (-127 to 127)
MaskImage (Image, Optional) Optional mask image
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.cielab();

imgproc.huesaturationintensity(original, hueShift, satShift, intShift, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Shifts Hue, Saturation, and Intensity channels in HSI color space

Description: Shifts Hue, Saturation, and Intensity channels in HSI color space.

Syntax: const result = await imgproc.huesaturationintensity(original, hueShift, satShift, intShift, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
original (Bitmap) Original input image
hueShift (Integer) Hue angle shift (-180 to 180)
satShift (Integer) Saturation shift (-100 to 100)
intShift (Integer) Intensity shift (-100 to 100)
MaskImage (Image, Optional) Optional mask image
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.huesaturationintensity();

imgproc.colorrangeselection(SourceImage, ColorCode, IsFastAlgorithm, Tolerance, MaintainOrgColor, ColorSpaceName, IsShowProgressBar, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Selects and filters specific color ranges across configured color spaces with tolerance parameters

Description: Selects and filters specific color ranges across configured color spaces with tolerance parameters.

Syntax: const result = await imgproc.colorrangeselection(SourceImage, ColorCode, IsFastAlgorithm, Tolerance, MaintainOrgColor, ColorSpaceName, IsShowProgressBar, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
ColorCode (Integer) Target color integer value
IsFastAlgorithm (Boolean) Flag to enable accelerated fast math calculation
Tolerance (Integer) Color distance tolerance threshold
MaintainOrgColor (Boolean) Preserve original colors for matched pixels
ColorSpaceName (String) Color space identifier ("RGB", "HSI", "LAB", etc.)
IsShowProgressBar (Boolean, Optional) Display execution progress bar
MaskImage (Bitmap, Optional) Optional mask image
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.colorrangeselection();

imgproc.grayscaling(SourceImage, IsShowProgress, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Converts RGB color image to 24-bit grayscale image using parallel processing

Description: Converts RGB color image to 24-bit grayscale image using parallel processing.

Syntax: const result = await imgproc.grayscaling(SourceImage, IsShowProgress, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
IsShowProgress (Boolean, Optional) Flag to show progress indicator
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let grayBmp; As Bitmap = imgproc.grayscaling();

imgproc.emboss(SourceImage, Angle, Distance, Strength, Bias, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies a fast parallel 3D embossed filter effect with configurable lighting angle, distance, strength, and bias

Description: Applies a fast parallel 3D embossed filter effect with configurable lighting angle, distance, strength, and bias.

Syntax: const result = await imgproc.emboss(SourceImage, Angle, Distance, Strength, Bias, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
Angle (Single, Optional) Light source direction angle in degrees
Distance (Integer, Optional) Shading distance offset in pixels
Strength (Single, Optional) Filter effect intensity multiplier
Bias (Integer, Optional) Gray level luminance bias offset
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let embBmp; As Bitmap = imgproc.emboss();

imgproc.outline(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Generates outline boundary contours of image objects in parallel

Description: Generates outline boundary contours of image objects in parallel.

Syntax: const result = await imgproc.outline(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let outlineBmp; As Bitmap = imgproc.outline();

imgproc.changenonblacktowhite(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Converts all non-black pixels in the image to pure white

Description: Converts all non-black pixels in the image to pure white.

Syntax: const result = await imgproc.changenonblacktowhite(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.changenonblacktowhite();

Color Conversion & Utilities

imgproc.colortocolorhex(SourceColor) – Converts System

Description: Converts System.Drawing.Color structure into a standard HEX color string (e.g. "#FF0000").

Syntax: const result = await imgproc.colortocolorhex(SourceColor);

Parameter Description
SourceColor (Color) System.Drawing.Color object

Return Value: String

JavaScript (Node.js / Browser) Example:

let hexVal; As String = imgproc.colortocolorhex();

imgproc.colorintegertorgb(PixelValue) – Parses an integer color value into internal RGB components

Description: Parses an integer color value into internal RGB components.

Syntax: await imgproc.colorintegertorgb(PixelValue);

Parameter Description
PixelValue (Integer) Packed RGB integer value

Return Value: None

JavaScript (Node.js / Browser) Example:

imgproc.colorintegertorgb();

imgproc.colorintegertoargb(PixelValue) – Parses an integer color value into internal ARGB components

Description: Parses an integer color value into internal ARGB components.

Syntax: await imgproc.colorintegertoargb(PixelValue);

Parameter Description
PixelValue (Integer) Packed ARGB integer value

Return Value: None

JavaScript (Node.js / Browser) Example:

imgproc.colorintegertoargb();

imgproc.rgbtoargbinteger(red, green, blue) – Combines Red, Green, and Blue component bytes into a single packed ARGB 32-bit integer

Description: Combines Red, Green, and Blue component bytes into a single packed ARGB 32-bit integer.

Syntax: const result = await imgproc.rgbtoargbinteger(red, green, blue);

Parameter Description
red (Integer) Red channel byte value (0-255)
green (Integer) Green channel byte value (0-255)
blue (Integer) Blue channel byte value (0-255)

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let colorInt; As Integer = imgproc.rgbtoargbinteger();

imgproc.rgbtocolor(RedInByte, GreenInByte, BlueInByte) – Constructs a System

Description: Constructs a System.Drawing.Color object from individual Red, Green, and Blue integer channel values.

Syntax: const result = await imgproc.rgbtocolor(RedInByte, GreenInByte, BlueInByte);

Parameter Description
RedInByte (Integer) Red channel value
GreenInByte (Integer) Green channel value
BlueInByte (Integer) Blue channel value

Return Value: Color

JavaScript (Node.js / Browser) Example:

let myColor; As Color = imgproc.rgbtocolor();

Pixel & Image Format Inspection

imgproc.isbwpixel(red, green, blue) – Evaluates whether given RGB byte channels represent a pure black or white pixel

Description: Evaluates whether given RGB byte channels represent a pure black or white pixel.

Syntax: const result = await imgproc.isbwpixel(red, green, blue);

Parameter Description
red (Byte) Red component
green (Byte) Green component
blue (Byte) Blue component

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isMonochrome; As Boolean = imgproc.isbwpixel();

imgproc.isgrayimage(SourceImage) – Inspects source bitmap to verify if all pixels have uniform RGB values (grayscale)

Description: Inspects source bitmap to verify if all pixels have uniform RGB values (grayscale).

Syntax: const result = await imgproc.isgrayimage(SourceImage);

Parameter Description
SourceImage (Bitmap) Source bitmap image

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isGray; As Boolean = imgproc.isgrayimage();

imgproc.isbinaryimage(SourceImage) – Inspects source bitmap to determine if it contains strictly binary (0 or 255) pixel values

Description: Inspects source bitmap to determine if it contains strictly binary (0 or 255) pixel values.

Syntax: const result = await imgproc.isbinaryimage(SourceImage);

Parameter Description
SourceImage (Bitmap) Source bitmap image

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isBinary; As Boolean = imgproc.isbinaryimage();

Halftoning & Dithering Filters

imgproc.bwDitheringFs(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies Floyd-Steinberg error diffusion dithering algorithm to produce a high-quality binary image

Description: Applies Floyd-Steinberg error diffusion dithering algorithm to produce a high-quality binary image.

Syntax: const result = await imgproc.bwDitheringFs(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let ditherBmp; As Bitmap = imgproc.bwDitheringFs();

imgproc.bwDitheringOrdereddither(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies matrix-based ordered dithering pattern to generate halftone binary images

Description: Applies matrix-based ordered dithering pattern to generate halftone binary images.

Syntax: const result = await imgproc.bwDitheringOrdereddither(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let ordDitherBmp; As Bitmap = imgproc.bwDitheringOrdereddither();

Matrix & Array Memory Conversions

imgproc.convertGraybytearrayToRgbimage(SrcByteArray) – Converts a 2D Byte array representing grayscale intensities into an RGB24 Bitmap image

Description: Converts a 2D Byte array representing grayscale intensities into an RGB24 Bitmap image.

Syntax: const result = await imgproc.convertGraybytearrayToRgbimage(SrcByteArray);

Parameter Description
SrcByteArray (Byte(,)) 2D byte array containing grayscale pixel values

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let myBmp; As Bitmap = imgproc.convertGraybytearrayToRgbimage();

imgproc.convertGraybytearrayToRgbimageInt(SrcByteArray) – Converts a 2D Integer array representing grayscale intensities into an RGB24 Bitmap image

Description: Converts a 2D Integer array representing grayscale intensities into an RGB24 Bitmap image.

Syntax: const result = await imgproc.convertGraybytearrayToRgbimageInt(SrcByteArray);

Parameter Description
SrcByteArray (Integer(,)) 2D integer array containing pixel values

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let myBmp; As Bitmap = imgproc.convertGraybytearrayToRgbimageInt();

imgproc.convertRgbbytearrayToRgbimage(SrcByteArray) – Converts a 3D Byte array [height, width, channel] into a 24-bit RGB Bitmap image

Description: Converts a 3D Byte array [height, width, channel] into a 24-bit RGB Bitmap image.

Syntax: const result = await imgproc.convertRgbbytearrayToRgbimage(SrcByteArray);

Parameter Description
SrcByteArray (Byte(,,)) 3D byte array containing RGB color channels

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let myBmp; As Bitmap = imgproc.convertRgbbytearrayToRgbimage();

imgproc.convertGrayimageToGraybytearray(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts grayscale bitmap pixel values directly into a 2D Byte array [height, width]

Description: Extracts grayscale bitmap pixel values directly into a 2D Byte array [height, width].

Syntax: const result = await imgproc.convertGrayimageToGraybytearray(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional ROI mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Byte(,)

JavaScript (Node.js / Browser) Example:

let byteMatrix;(,) As Byte = ImgProc.[...](asc_slot://start-slot-1)Convert_GrayImage_To_GrayByteArray(srcBmp);

imgproc.convertRgbimageToRgbbytearray(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts RGB color bitmap pixel values directly into a 3D Byte array

Description: Extracts RGB color bitmap pixel values directly into a 3D Byte array.

Syntax: const result = await imgproc.convertRgbimageToRgbbytearray(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional ROI mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Byte(,,)

JavaScript (Node.js / Browser) Example:

let rgbMatrix;(,,) As Byte = imgproc.convertRgbimageToRgbbytearray();

imgproc.convertRgbimageToGraybytearray(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Converts RGB image to grayscale and outputs pixel values to a 2D Byte matrix

Description: Converts RGB image to grayscale and outputs pixel values to a 2D Byte matrix.

Syntax: const result = await imgproc.convertRgbimageToGraybytearray(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Byte(,)

JavaScript (Node.js / Browser) Example:

let grayMatrix;(,) As Byte = imgproc.convertRgbimageToGraybytearray();

imgproc.convertRgbimageToGrayintegerarray(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Converts RGB image to grayscale and outputs pixel values to a 2D Integer matrix

Description: Converts RGB image to grayscale and outputs pixel values to a 2D Integer matrix.

Syntax: const result = await imgproc.convertRgbimageToGrayintegerarray(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Integer(,)

JavaScript (Node.js / Browser) Example:

let intMatrix;(,) As Integer = imgproc.convertRgbimageToGrayintegerarray();

imgproc.grayscalingPutto2dbyte(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Performs grayscale conversion and fills output directly to 2D Byte matrix array

Description: Performs grayscale conversion and fills output directly to 2D Byte matrix array.

Syntax: const result = await imgproc.grayscalingPutto2dbyte(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Byte(,)

JavaScript (Node.js / Browser) Example:

let resMatrix;(,) As Byte = imgproc.grayscalingPutto2dbyte();

imgproc.grayscalingPutto2dint(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Performs grayscale conversion and fills output directly to 2D Integer matrix array

Description: Performs grayscale conversion and fills output directly to 2D Integer matrix array.

Syntax: const result = await imgproc.grayscalingPutto2dint(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Integer(,)

JavaScript (Node.js / Browser) Example:

let resIntMatrix;(,) As Integer = imgproc.grayscalingPutto2dint();

imgproc.grayscalingReturnimgFrom2dint(SourceImage, Gray2DInt, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Reconstructs Bitmap image from 2D Integer grayscale matrix data

Description: Reconstructs Bitmap image from 2D Integer grayscale matrix data.

Syntax: const result = await imgproc.grayscalingReturnimgFrom2dint(SourceImage, Gray2DInt, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Reference source bitmap
Gray2DInt (Integer(,)) 2D integer grayscale values matrix
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let resBmp; As Bitmap = imgproc.grayscalingReturnimgFrom2dint();

imgproc.overlayGrayintarrayOnImage(SourceImage, Gray2DInt, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Overlays a 2D Integer grayscale intensity matrix onto an existing image within masked ROI boundaries

Description: Overlays a 2D Integer grayscale intensity matrix onto an existing image within masked ROI boundaries.

Syntax: const result = await imgproc.overlayGrayintarrayOnImage(SourceImage, Gray2DInt, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source background bitmap
Gray2DInt (Integer(,)) 2D integer array containing overlay values
MaskImage (Bitmap) ROI mask image
MaskRegionBoundary (Rectangle) Boundary rectangle for ROI
IsMaskAllRegionSelected (Boolean) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let resBmp; = imgproc.overlayGrayintarrayOnImage();

Geometric Transformations

imgproc.resizebyzoomfactor(SourceImage, ZoomFactor, InterpolationMode) – Resizes image relative to current dimensions using zoom scale factor

Description: Resizes image relative to current dimensions using zoom scale factor.

Syntax: const result = await imgproc.resizebyzoomfactor(SourceImage, ZoomFactor, InterpolationMode);

Parameter Description
SourceImage (Bitmap) Source bitmap image
ZoomFactor (Single) Scaling factor (e.g. 1.5 = 150%, 0.5 = 50%)
InterpolationMode (InterpolationMode, Optional) Quality resampling mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let zoomedBmp; As Bitmap = imgproc.resizebyzoomfactor();

imgproc.resize(SourceImage, nWidth, nHeight, InterpolationMode) – Resizes bitmap to target explicit width and height dimensions in pixels

Description: Resizes bitmap to target explicit width and height dimensions in pixels.

Syntax: const result = await imgproc.resize(SourceImage, nWidth, nHeight, InterpolationMode);

Parameter Description
SourceImage (Bitmap) Source bitmap image
nWidth (Integer) Target width in pixels
nHeight (Integer) Target height in pixels
InterpolationMode (InterpolationMode, Optional) Quality resampling mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let resizedBmp; As Bitmap = imgproc.resize();

imgproc.crop(SourceImage, nWidth, nHeight, TargetX, TargetY) – Crops a sub-region rectangle from source bitmap given origin coordinates and size

Description: Crops a sub-region rectangle from source bitmap given origin coordinates and size.

Syntax: const result = await imgproc.crop(SourceImage, nWidth, nHeight, TargetX, TargetY);

Parameter Description
SourceImage (Bitmap) Source bitmap image
nWidth (Integer) Crop rectangle width
nHeight (Integer) Crop rectangle height
TargetX (Integer) Crop region top-left X position
TargetY (Integer) Crop region top-left Y position

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let subBmp; As Bitmap = imgproc.crop();

imgproc.rotate(SourceImage, CenterX, CenterY, AngleDegree, BackgroundColor) – Rotates image around a custom pivot center coordinate (CenterX, CenterY) by angle degrees

Description: Rotates image around a custom pivot center coordinate (CenterX, CenterY) by angle degrees.

Syntax: const result = await imgproc.rotate(SourceImage, CenterX, CenterY, AngleDegree, BackgroundColor);

Parameter Description
SourceImage (Bitmap) Source bitmap image
CenterX (Integer) Pivot point X coordinate
CenterY (Integer) Pivot point Y coordinate
AngleDegree (Single) Rotation angle in degrees
BackgroundColor (Color) Background fill color for exposed corners

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let rotBmp; As Bitmap = imgproc.rotate();

imgproc.rotateatcenter(SourceImage, AngleDegree) – Rotates image centered on its exact geometric midpoint by angle degrees

Description: Rotates image centered on its exact geometric midpoint by angle degrees.

Syntax: const result = await imgproc.rotateatcenter(SourceImage, AngleDegree);

Parameter Description
SourceImage (Bitmap) Source bitmap image
AngleDegree (Single) Rotation angle in degrees

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let rotBmp; As Bitmap = imgproc.rotateatcenter();

imgproc.flipVertical(SourceImage) – Flips bitmap vertically along the horizontal axis

Description: Flips bitmap vertically along the horizontal axis.

Syntax: const result = await imgproc.flipVertical(SourceImage);

Parameter Description
SourceImage (Bitmap) Source bitmap image

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let flippedBmp; As Bitmap = imgproc.flipVertical();

imgproc.flipHorizontal(SourceImage) – Flips bitmap horizontally along the vertical axis

Description: Flips bitmap horizontally along the vertical axis.

Syntax: const result = await imgproc.flipHorizontal(SourceImage);

Parameter Description
SourceImage (Bitmap) Source bitmap image

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let flippedBmp; As Bitmap = imgproc.flipHorizontal();

imgproc.rotateflip(SourceImage, RotateFlipOption) – Performs combined rotation and flip transformation using System

Description: Performs combined rotation and flip transformation using System.Drawing.RotateFlipType options.

Syntax: const result = await imgproc.rotateflip(SourceImage, RotateFlipOption);

Parameter Description
SourceImage (Bitmap) Source bitmap image
RotateFlipOption (RotateFlipType) GDI+ RotateFlipType enumeration option

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let resBmp; As Bitmap = imgproc.rotateflip();

Filtering & Enhancement

imgproc.boxaveraging(SourceImage, BoxSizeHalf, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies a fast parallel box averaging blur filter using a square neighborhood kernel

Description: Applies a fast parallel box averaging blur filter using a square neighborhood kernel.

Syntax: const result = await imgproc.boxaveraging(SourceImage, BoxSizeHalf, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
BoxSizeHalf (Integer) Half-width radius of the blur box kernel
MaskImage (Bitmap, Optional) Optional ROI mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let blurBmp; As Bitmap = imgproc.boxaveraging();

imgproc.gaussianfilter(SourceImage, FilterSize, WeightFactor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies parallel Gaussian smoothing filter to reduce image noise and detail

Description: Applies parallel Gaussian smoothing filter to reduce image noise and detail.

Syntax: const result = await imgproc.gaussianfilter(SourceImage, FilterSize, WeightFactor, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
FilterSize (Integer) Kernel filter size (must be odd number)
WeightFactor (Integer, Optional) Gaussian weight factor
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let gImg; As Bitmap = imgproc.gaussianfilter();

imgproc.sharpen3x3(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies standard 3×3 kernel sharpening filter in parallel

Description: Applies standard 3×3 kernel sharpening filter in parallel.

Syntax: const result = await imgproc.sharpen3x3(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.sharpen3x3();

imgproc.sharpen3x3Improved(SourceImage, Strength, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies improved 3×3 parallel sharpening filter with adjustable strength multiplier

Description: Applies improved 3×3 parallel sharpening filter with adjustable strength multiplier.

Syntax: const result = await imgproc.sharpen3x3Improved(SourceImage, Strength, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
Strength (Single, Optional) Sharpening strength factor
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.sharpen3x3Improved();

imgproc.sharpen5x5HighqualityFixed(SourceImage, Strength, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies high-quality 5×5 fixed kernel sharpening filter with strength control

Description: Applies high-quality 5×5 fixed kernel sharpening filter with strength control.

Syntax: const result = await imgproc.sharpen5x5HighqualityFixed(SourceImage, Strength, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
Strength (Single, Optional) Sharpening strength factor
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.sharpen5x5HighqualityFixed();

imgproc.mosaicfilter(SourceImage, isPixelMode, value, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies pixelation or block mosaic effect over the image or selected ROI

Description: Applies pixelation or block mosaic effect over the image or selected ROI.

Syntax: const result = await imgproc.mosaicfilter(SourceImage, isPixelMode, value, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
isPixelMode (Boolean) True for pixel block mode, False for cell grid mode
value (Integer) Block size or pixelation magnitude
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let mosaicBmp; As Bitmap = imgproc.mosaicfilter();

Edge Detection & Morphology

imgproc.erode(SourceImage, BoxSizeHalf, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected, IsDoGrayScaling) – Applies morphological erosion filter using square box neighborhood

Description: Applies morphological erosion filter using square box neighborhood.

Syntax: const result = await imgproc.erode(SourceImage, BoxSizeHalf, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected, IsDoGrayScaling);

Parameter Description
SourceImage (Bitmap) Source bitmap image
BoxSizeHalf (Integer) Structuring element half-size radius
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode
IsDoGrayScaling (Boolean, Optional) Convert image to grayscale before processing

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.erode();

imgproc.dilate(SourceImage, BoxSizeHalf, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected, IsDoGrayScaling) – Applies morphological dilation filter using square box neighborhood

Description: Applies morphological dilation filter using square box neighborhood.

Syntax: const result = await imgproc.dilate(SourceImage, BoxSizeHalf, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected, IsDoGrayScaling);

Parameter Description
SourceImage (Bitmap) Source bitmap image
BoxSizeHalf (Integer) Structuring element half-size radius
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode
IsDoGrayScaling (Boolean, Optional) Convert image to grayscale before processing

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.dilate();

imgproc.edgedetectBySobel(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Detects image edges using Sobel operator masks

Description: Detects image edges using Sobel operator masks.

Syntax: const result = await imgproc.edgedetectBySobel(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let edgeImg; As Bitmap = imgproc.edgedetectBySobel();

imgproc.edgedetectByHomogenity(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Detects edges based on regional homogenity differential calculation

Description: Detects edges based on regional homogenity differential calculation.

Syntax: const result = await imgproc.edgedetectByHomogenity(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let edgeImg; As Bitmap = imgproc.edgedetectByHomogenity();

imgproc.erodeoutlines(SourceGrayImage, BackgroundGray, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Erodes region object boundaries in grayscale image by applying background gray adjustments

Description: Erodes region object boundaries in grayscale image by applying background gray adjustments.

Syntax: const result = await imgproc.erodeoutlines(SourceGrayImage, BackgroundGray, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceGrayImage (Bitmap) Source grayscale bitmap image
BackgroundGray (Byte) Background gray intensity byte value
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.erodeoutlines();

imgproc.dilateoutlines(SourceGrayImage, BackgroundGray, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Dilates region object boundaries in grayscale image by applying foreground gray adjustments

Description: Dilates region object boundaries in grayscale image by applying foreground gray adjustments.

Syntax: const result = await imgproc.dilateoutlines(SourceGrayImage, BackgroundGray, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceGrayImage (Bitmap) Source grayscale bitmap image
BackgroundGray (Byte) Background gray intensity byte value
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.dilateoutlines();

Color Channel Splitting & Extraction

imgproc.splitRed(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts Red color channel into a color image with Green/Blue suppressed

Description: Extracts Red color channel into a color image with Green/Blue suppressed.

Syntax: const result = await imgproc.splitRed(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let redCh; = imgproc.splitRed();

imgproc.splitGreen(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts Green color channel into a color image with Red/Blue suppressed

Description: Extracts Green color channel into a color image with Red/Blue suppressed.

Syntax: const result = await imgproc.splitGreen(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let greenCh; = imgproc.splitGreen();

imgproc.splitBlue(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts Blue color channel into a color image with Red/Green suppressed

Description: Extracts Blue color channel into a color image with Red/Green suppressed.

Syntax: const result = await imgproc.splitBlue(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let blueCh; = imgproc.splitBlue();

imgproc.grayfromRed(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts Red channel intensity directly into a 24-bit grayscale bitmap

Description: Extracts Red channel intensity directly into a 24-bit grayscale bitmap.

Syntax: const result = await imgproc.grayfromRed(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let redGrayBmp; = imgproc.grayfromRed();

imgproc.grayfromGreen(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts Green channel intensity directly into a 24-bit grayscale bitmap

Description: Extracts Green channel intensity directly into a 24-bit grayscale bitmap.

Syntax: const result = await imgproc.grayfromGreen(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let greenGrayBmp; = imgproc.grayfromGreen();

imgproc.grayfromBlue(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts Blue channel intensity directly into a 24-bit grayscale bitmap

Description: Extracts Blue channel intensity directly into a 24-bit grayscale bitmap.

Syntax: const result = await imgproc.grayfromBlue(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let blueGrayBmp; = imgproc.grayfromBlue();

imgproc.splitHue(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts Hue channel component from HSI color space into a grayscale image

Description: Extracts Hue channel component from HSI color space into a grayscale image.

Syntax: const result = await imgproc.splitHue(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let hueBmp; = imgproc.splitHue();

imgproc.splitSaturation(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts Saturation channel component from HSI color space into a grayscale image

Description: Extracts Saturation channel component from HSI color space into a grayscale image.

Syntax: const result = await imgproc.splitSaturation(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let satBmp; = imgproc.splitSaturation();

imgproc.splitIntensity(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Extracts Intensity channel component from HSI color space into a grayscale image

Description: Extracts Intensity channel component from HSI color space into a grayscale image.

Syntax: const result = await imgproc.splitIntensity(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let intBmp; = imgproc.splitIntensity();

Color Space Conversions (Point-wise)

imgproc.rgbtocmyk(r, g, b, IsCompute_Cyan, IsCompute_Magenta, IsCompute_Yellow) – Converts RGB byte values to CMYK color channel components

Description: Converts RGB byte values to CMYK color channel components.

Syntax: await imgproc.rgbtocmyk(r, g, b, IsCompute_Cyan, IsCompute_Magenta, IsCompute_Yellow);

Parameter Description
r (Byte) Red channel byte
g (Byte) Green channel byte
b (Byte) Blue channel byte
IsCompute_Cyan (Boolean) Compute cyan component flag
IsCompute_Magenta (Boolean) Compute magenta component flag
IsCompute_Yellow (Boolean) Compute yellow component flag

Return Value: None

JavaScript (Node.js / Browser) Example:

imgproc.rgbtocmyk();

imgproc.rgbtolab(r, g, b) – Converts RGB byte values to CIELAB space byte components

Description: Converts RGB byte values to CIELAB space byte components.

Syntax: await imgproc.rgbtolab(r, g, b);

Parameter Description
r (Byte) Red channel byte
g (Byte) Green channel byte
b (Byte) Blue channel byte

Return Value: None

JavaScript (Node.js / Browser) Example:

imgproc.rgbtolab();

imgproc.rgbtolabOriginalvalue(r, g, b, LabL, Laba, Labb) – Converts RGB byte values to double-precision CIELAB (L*, a*, b*) values

Description: Converts RGB byte values to double-precision CIELAB (L*, a*, b*) values.

Syntax: await imgproc.rgbtolabOriginalvalue(r, g, b, LabL, Laba, Labb);

Parameter Description
r (Byte) Red channel byte
g (Byte) Green channel byte
b (Byte) Blue channel byte
LabL (Double) ByRef output Lightness L*
Laba (Double) ByRef output a* channel
Labb (Double) ByRef output b* channel

Return Value: None

JavaScript (Node.js / Browser) Example:

let L; As Double, a As Double, b As Double;
imgproc.rgbtolabOriginalvalue();

imgproc.rgbtohsi(r, g, b) – Converts RGB byte values to HSI space components

Description: Converts RGB byte values to HSI space components.

Syntax: await imgproc.rgbtohsi(r, g, b);

Parameter Description
r (Byte) Red channel byte
g (Byte) Green channel byte
b (Byte) Blue channel byte

Return Value: None

JavaScript (Node.js / Browser) Example:

imgproc.rgbtohsi();

imgproc.hsvtorgb(h, s, v, r, g, b) – Converts HSV color components (Hue, Saturation, Value) to RGB byte components

Description: Converts HSV color components (Hue, Saturation, Value) to RGB byte components.

Syntax: await imgproc.hsvtorgb(h, s, v, r, g, b);

Parameter Description
h (Single) Hue angle (0.0 to 360.0)
s (Single) Saturation (0.0 to 1.0)
v (Single) Value/Brightness (0.0 to 1.0)
r (Byte) ByRef output Red byte
g (Byte) ByRef output Green byte
b (Byte) ByRef output Blue byte

Return Value: None

JavaScript (Node.js / Browser) Example:

let r; As Byte, g As Byte, b As Byte;
imgproc.hsvtorgb();

imgproc.hsitorgb(Hue, Saturation255, Intensity255, Red, Green, Blue) – Converts HSI channel inputs to Red, Green, and Blue integer color values

Description: Converts HSI channel inputs to Red, Green, and Blue integer color values.

Syntax: await imgproc.hsitorgb(Hue, Saturation255, Intensity255, Red, Green, Blue);

Parameter Description
Hue (Integer) Hue angle in degrees (0-360)
Saturation255 (Single) Saturation scaled 0-255
Intensity255 (Single) Intensity scaled 0-255
Red (Integer) ByRef output Red integer
Green (Integer) ByRef output Green integer
Blue (Integer) ByRef output Blue integer

Return Value: None

JavaScript (Node.js / Browser) Example:

let r; As Integer, g As Integer, b As Integer;
imgproc.hsitorgb();

Region Filling & Compositing

imgproc.fillregion(SourceImage, FillColorStr, IsFillInside, Opacity, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Fills interior or exterior of ROI mask with color string and opacity

Description: Fills interior or exterior of ROI mask with color string and opacity.

Syntax: const result = await imgproc.fillregion(SourceImage, FillColorStr, IsFillInside, Opacity, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
FillColorStr (String) Color HEX or name string
IsFillInside (Boolean) True to fill inside ROI mask, False for outside
Opacity (Single) Fill opacity factor (0.0 to 1.0)
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.fillregion();

imgproc.chromakey(TargetCanvas, OverlayImage, ChromaR, ChromaG, ChromaB, Opacity, IsFeather, FeatherRadius, MaskImage, IsMaskAllRegionSelected) – Performs chroma key compositing overlaying image onto target canvas with alpha feathering

Description: Performs chroma key compositing overlaying image onto target canvas with alpha feathering.

Syntax: const result = await imgproc.chromakey(TargetCanvas, OverlayImage, ChromaR, ChromaG, ChromaB, Opacity, IsFeather, FeatherRadius, MaskImage, IsMaskAllRegionSelected);

Parameter Description
TargetCanvas (Bitmap) Target canvas bitmap
OverlayImage (Bitmap) Overlay source image
ChromaR (Byte) Chroma key color Red component
ChromaG (Byte) Chroma key color Green component
ChromaB (Byte) Chroma key color Blue component
Opacity (Single) Overlay blend opacity (0.0 to 1.0)
IsFeather (Boolean) Enable edge feathering
FeatherRadius (Integer) Feathering blur radius in pixels
MaskImage (Bitmap, Optional) Optional mask bitmap
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.chromakey();

imgproc.floodfill(SourceImage, CenterX, CenterY, FillColorR, FillColorG, FillColorB, ToleranceR, ToleranceG, ToleranceB, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Executes 4-connected flood fill starting at target coordinate with RGB color tolerance

Description: Executes 4-connected flood fill starting at target coordinate with RGB color tolerance.

Syntax: const result = await imgproc.floodfill(SourceImage, CenterX, CenterY, FillColorR, FillColorG, FillColorB, ToleranceR, ToleranceG, ToleranceB, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
CenterX (Integer) Seed point X coordinate
CenterY (Integer) Seed point Y coordinate
FillColorR (Byte) Target fill color Red component
FillColorG (Byte) Target fill color Green component
FillColorB (Byte) Target fill color Blue component
ToleranceR (Integer) Red channel tolerance threshold
ToleranceG (Integer) Green channel tolerance threshold
ToleranceB (Integer) Blue channel tolerance threshold
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.floodfill();

imgproc.invert(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Inverts color values (negative effect) across all image channels

Description: Inverts color values (negative effect) across all image channels.

Syntax: const result = await imgproc.invert(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let negBmp; = imgproc.invert();

Binarization & Thresholding

imgproc.manualbinarization(SourceImage, ThresholdValue, SkipGrayScaling, IsShowProgress, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Converts image to binary mask using explicit cutoff threshold value

Description: Converts image to binary mask using explicit cutoff threshold value.

Syntax: const result = await imgproc.manualbinarization(SourceImage, ThresholdValue, SkipGrayScaling, IsShowProgress, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
ThresholdValue (Integer) Binarization threshold (0 to 255)
SkipGrayScaling (Boolean, Optional) Skip internal grayscale step if input is already gray
IsShowProgress (Boolean, Optional) Display execution progress
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let binBmp; = imgproc.manualbinarization();

imgproc.adaptivebinarization(SourceImage, LocalBoxSizeValue, IsObjectWhite, ThresholdLevel, IsShowProgress, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Executes local adaptive threshold binarization based on local neighborhood box averages

Description: Executes local adaptive threshold binarization based on local neighborhood box averages.

Syntax: const result = await imgproc.adaptivebinarization(SourceImage, LocalBoxSizeValue, IsObjectWhite, ThresholdLevel, IsShowProgress, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
LocalBoxSizeValue (Integer) Local window box size in pixels
IsObjectWhite (Boolean) True if foreground objects are lighter than background
ThresholdLevel (Integer) Sensitivity offset parameter
IsShowProgress (Boolean, Optional) Display execution progress
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.adaptivebinarization();

imgproc.multistepthresholding(SourceImage, LevelCount_Red, LevelCount_Green, LevelCount_Blue, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies multi-level thresholding across Red, Green, and Blue color channels independently

Description: Applies multi-level thresholding across Red, Green, and Blue color channels independently.

Syntax: const result = await imgproc.multistepthresholding(SourceImage, LevelCount_Red, LevelCount_Green, LevelCount_Blue, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
LevelCount_Red (Integer) Number of quantization levels for Red channel
LevelCount_Green (Integer) Number of quantization levels for Green channel
LevelCount_Blue (Integer) Number of quantization levels for Blue channel
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.multistepthresholding();

Drawing & Text Overlays

imgproc.drawLine(Pic_Target, X1, Y1, X2, Y2, LineColor) – Renders a solid colored line between two pixel coordinates onto target PictureBox image

Description: Renders a solid colored line between two pixel coordinates onto target PictureBox image.

Syntax: const result = await imgproc.drawLine(Pic_Target, X1, Y1, X2, Y2, LineColor);

Parameter Description
Pic_Target (PictureBox) Target PictureBox control
X1 (Integer) Starting X coordinate
Y1 (Integer) Starting Y coordinate
X2 (Integer) Ending X coordinate
Y2 (Integer) Ending Y coordinate
LineColor (Color) Line color

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.drawLine();

imgproc.drawTextOutlinedBitmap(Pic_Target, x, y, TextString, TextFont, InnerColor, OuterColor) – Renders text with inner fill and outer outline stroke onto a Bitmap canvas

Description: Renders text with inner fill and outer outline stroke onto a Bitmap canvas.

Syntax: const result = await imgproc.drawTextOutlinedBitmap(Pic_Target, x, y, TextString, TextFont, InnerColor, OuterColor);

Parameter Description
Pic_Target (Bitmap) Target bitmap canvas
x (Integer) X position
y (Integer) Y position
TextString (String) Text string to render
TextFont (Font) System.Drawing.Font object
InnerColor (Color) Text inner fill color
OuterColor (Color) Outline stroke color

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let fnt; As New Font("Arial", 12.0F);
let res; = imgproc.drawTextOutlinedBitmap();

imgproc.drawRectangles(Pic_Target, SourceRectangles, LineColor) – Draws an array of bounding rectangles onto bitmap using specified stroke color

Description: Draws an array of bounding rectangles onto bitmap using specified stroke color.

Syntax: const result = await imgproc.drawRectangles(Pic_Target, SourceRectangles, LineColor);

Parameter Description
Pic_Target (Bitmap) Target bitmap
SourceRectangles (Rectangle()) Array of Rectangle structures
LineColor (Color) Stroke color for rectangle boundaries

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let rects;() As Rectangle = { New Rectangle(10,10,50,50) };
let res; = imgproc.drawRectangles();

Pixel Analysis & Measurements

imgproc.getHistogram(SourceImage, TotalPixelCount, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Calculates pixel intensity frequency distribution histogram matrix for source image

Description: Calculates pixel intensity frequency distribution histogram matrix for source image.

Syntax: const result = await imgproc.getHistogram(SourceImage, TotalPixelCount, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
TotalPixelCount (Integer) ByRef output total evaluated pixel count
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Single(,)

JavaScript (Node.js / Browser) Example:

let totCount; As Integer;
let hist;(,) As Single = imgproc.getHistogram();

imgproc.getLineprofile(SourceImage, StartAt, EndAt, LineThickness, IsNormalizeBy255) – Extracts intensity or color channel profiles along a defined line segment [StartAt -> EndAt]

Description: Extracts intensity or color channel profiles along a defined line segment [StartAt -> EndAt].

Syntax: const result = await imgproc.getLineprofile(SourceImage, StartAt, EndAt, LineThickness, IsNormalizeBy255);

Parameter Description
SourceImage (Bitmap) Source bitmap image
StartAt (Point) Starting point coordinate
EndAt (Point) Ending point coordinate
LineThickness (Integer) Profile sampling line width in pixels
IsNormalizeBy255 (Boolean, Optional) Normalize profile values to 0.0-1.0 range

Return Value: Single(,)

JavaScript (Node.js / Browser) Example:

let profile;(,) As Single = imgproc.getLineprofile(), New Point(100,100), 3);

imgproc.calculateAveragecolorvalue(SourceImage, TotalPixelsCount, AnalysisInterval, ColorChannel, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Calculates average value for a specific named color channel across selected ROI

Description: Calculates average value for a specific named color channel across selected ROI.

Syntax: const result = await imgproc.calculateAveragecolorvalue(SourceImage, TotalPixelsCount, AnalysisInterval, ColorChannel, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
TotalPixelsCount (Long) ByRef output total analyzed pixel count
AnalysisInterval (Integer) Pixel step sampling interval (e.g. 1 = every pixel)
ColorChannel (String) Channel name ("Red", "Green", "Blue", "Gray", etc.)
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Single

JavaScript (Node.js / Browser) Example:

let pxCount; As Long;
let avgRed; As Single = imgproc.calculateAveragecolorvalue();

imgproc.distance(X1, Y1, X2, Y2) – Calculates Euclidean distance between two 2D points (X1, Y1) and (X2, Y2)

Description: Calculates Euclidean distance between two 2D points (X1, Y1) and (X2, Y2).

Syntax: const result = await imgproc.distance(X1, Y1, X2, Y2);

Parameter Description
X1 (Double) Point 1 X coordinate
Y1 (Double) Point 1 Y coordinate
X2 (Double) Point 2 X coordinate
Y2 (Double) Point 2 Y coordinate

Return Value: Double

JavaScript (Node.js / Browser) Example:

let d; As Double = imgproc.distance();

imgproc.countColorpixelofinterest(SourceImage, ColorOfInterest_RGBInt, TotalPixelCount, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Counts total pixels matching specified RGB color integer value within ROI

Description: Counts total pixels matching specified RGB color integer value within ROI.

Syntax: const result = await imgproc.countColorpixelofinterest(SourceImage, ColorOfInterest_RGBInt, TotalPixelCount, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
ColorOfInterest_RGBInt (Integer) Packed target RGB integer value
TotalPixelCount (Integer) ByRef output total evaluated pixels count
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let totPx; As Integer;
let redCount; As Integer = imgproc.countColorpixelofinterest();

Automated Image Enhancement & Restoration

imgproc.rollingboxbackgroundsubtraction(SourceImage, Radius, IsAutomatic, IsObjectWhite, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Subtractions non-uniform background illumination using parallel rolling box/ball algorithm

Description: Subtractions non-uniform background illumination using parallel rolling box/ball algorithm.

Syntax: const result = await imgproc.rollingboxbackgroundsubtraction(SourceImage, Radius, IsAutomatic, IsObjectWhite, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
Radius (Integer) Rolling ball/box pixel radius
IsAutomatic (Boolean, Optional) Enable automatic radius calculation
IsObjectWhite (Boolean, Optional) True if target objects are bright on dark background
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let resBmp; = imgproc.rollingboxbackgroundsubtraction();

imgproc.correctunevenillumination(SourceImage, GridRows, GridCols, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Corrects uneven field shading and vignetting by estimating background surface grid in parallel

Description: Corrects uneven field shading and vignetting by estimating background surface grid in parallel.

Syntax: const result = await imgproc.correctunevenillumination(SourceImage, GridRows, GridCols, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
GridRows (Integer, Optional) Number of grid estimation rows
GridCols (Integer, Optional) Number of grid estimation columns
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let flatImg; = imgproc.correctunevenillumination();

imgproc.smartdenoise(SourceImage, Radius, Threshold, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies edge-preserving bilateral smart noise reduction filter

Description: Applies edge-preserving bilateral smart noise reduction filter.

Syntax: const result = await imgproc.smartdenoise(SourceImage, Radius, Threshold, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
Radius (Integer, Optional) Filter spatial neighborhood radius
Threshold (Integer, Optional) Photometric intensity difference threshold
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let cleanImg; = imgproc.smartdenoise();

imgproc.adaptivecontrast(SourceImage, Strength, TilesX, TilesY, ClipLimit, IsShowProgress, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies Contrast Limited Adaptive Histogram Equalization (CLAHE) in parallel

Description: Applies Contrast Limited Adaptive Histogram Equalization (CLAHE) in parallel.

Syntax: const result = await imgproc.adaptivecontrast(SourceImage, Strength, TilesX, TilesY, ClipLimit, IsShowProgress, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
Strength (Single, Optional) Contrast enhancement strength (0.0 to 1.0)
TilesX (Integer, Optional) Number of tile grid columns
TilesY (Integer, Optional) Number of tile grid rows
ClipLimit (Single, Optional) Histogram clipping threshold limit
IsShowProgress (Boolean, Optional) Display progress indicator
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let claheBmp; = imgproc.adaptivecontrast();

imgproc.autotone(SourceImage, ClipPercent, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Automatically balances tonal range across individual color channels by clipping histogram tails

Description: Automatically balances tonal range across individual color channels by clipping histogram tails.

Syntax: const result = await imgproc.autotone(SourceImage, ClipPercent, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
ClipPercent (Single, Optional) Histogram end clipping percentage
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.autotone();

imgproc.autowhitebalance(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Automatically corrects color temperature and casts using gray world assumption

Description: Automatically corrects color temperature and casts using gray world assumption.

Syntax: const result = await imgproc.autowhitebalance(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let awbBmp; = imgproc.autowhitebalance();

imgproc.autogamma(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Automatically computes and applies optimal gamma correction curves

Description: Automatically computes and applies optimal gamma correction curves.

Syntax: const result = await imgproc.autogamma(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let gammaBmp; = imgproc.autogamma();

imgproc.sharpenUnsharpmask(SourceImage, FilterSize, AmountPercent, Threshold, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies high-grade Unsharp Masking (USM) filter with threshold control

Description: Applies high-grade Unsharp Masking (USM) filter with threshold control.

Syntax: const result = await imgproc.sharpenUnsharpmask(SourceImage, FilterSize, AmountPercent, Threshold, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
FilterSize (Integer, Optional) Gaussian blur kernel size
AmountPercent (Integer, Optional) Sharpening effect amount percentage
Threshold (Integer, Optional) Minimum edge contrast threshold
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let usmBmp; = imgproc.sharpenUnsharpmask();

imgproc.removebackground(SourceImage, MatteImage, MaskRegionBoundary, IsMaskAllRegionSelected, BgColor, NewBackgroundImage) – Removes image background using matte alpha keying and optional new background substitution

Description: Removes image background using matte alpha keying and optional new background substitution.

Syntax: const result = await imgproc.removebackground(SourceImage, MatteImage, MaskRegionBoundary, IsMaskAllRegionSelected, BgColor, NewBackgroundImage);

Parameter Description
SourceImage (Bitmap) Source foreground image
MatteImage (Bitmap) Matte alpha channel bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode
BgColor (Color, Optional) Replacement solid background color
NewBackgroundImage (Bitmap, Optional) Replacement background image

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let cutBmp; = imgproc.removebackground();

Advanced Segmentation, Skeletonization & 3D Export

imgproc.watershedsegmentation(SourceImage, MinDistanceThreshold, SmoothRadius, BoundaryThickness, BoundR, BoundG, BoundB, ReturnOnlyBoundaries, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Executes distance-transform parallel Watershed segmentation to separate overlapping object boundaries

Description: Executes distance-transform parallel Watershed segmentation to separate overlapping object boundaries.

Syntax: const result = await imgproc.watershedsegmentation(SourceImage, MinDistanceThreshold, SmoothRadius, BoundaryThickness, BoundR, BoundG, BoundB, ReturnOnlyBoundaries, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source binary/grayscale image
MinDistanceThreshold (Integer, Optional) Minimum distance peak threshold
SmoothRadius (Integer, Optional) Smoothing filter radius for seed generation
BoundaryThickness (Integer, Optional) Line thickness for drawn watershed boundaries
BoundR (Byte, Optional) Boundary line Red component
BoundG (Byte, Optional) Boundary line Green component
BoundB (Byte, Optional) Boundary line Blue component
ReturnOnlyBoundaries (Boolean, Optional) True to return boundary lines only
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let wsBmp; = imgproc.watershedsegmentation();

imgproc.splitobjectsConvexitydefects(SourceImage, MinDefectDepth, MaxCutLength, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Splits clustered binary objects by locating contour convexity defects

Description: Splits clustered binary objects by locating contour convexity defects.

Syntax: const result = await imgproc.splitobjectsConvexitydefects(SourceImage, MinDefectDepth, MaxCutLength, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source binary bitmap
MinDefectDepth (Single, Optional) Minimum defect notch depth
MaxCutLength (Single, Optional) Maximum allowed cut line distance
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let splitBmp; = imgproc.splitobjectsConvexitydefects();

imgproc.skeletonize(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Reduces binary object shapes to 1-pixel thin medial axis skeleton curves in parallel

Description: Reduces binary object shapes to 1-pixel thin medial axis skeleton curves in parallel.

Syntax: const result = await imgproc.skeletonize(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source binary bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let skelBmp; = imgproc.skeletonize();

imgproc.skeletonizeextended(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies extended topological skeletonization preserving critical branch junction topology

Description: Applies extended topological skeletonization preserving critical branch junction topology.

Syntax: const result = await imgproc.skeletonizeextended(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source binary bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let extSkel; = imgproc.skeletonizeextended();

imgproc.extractSkeletonpoints(SkeletonArray, foreground) – Extracts 2D coordinate points of all foreground skeleton pixels from matrix array

Description: Extracts 2D coordinate points of all foreground skeleton pixels from matrix array.

Syntax: const result = await imgproc.extractSkeletonpoints(SkeletonArray, foreground);

Parameter Description
SkeletonArray (Byte(,)) 2D byte array storing skeleton matrix
foreground (Byte) Foreground pixel intensity value (e.g. 255)

Return Value: Point()

JavaScript (Node.js / Browser) Example:

let pts;() As Point = imgproc.extractSkeletonpoints();

imgproc.getTrueskeletonlength(SkeletonArray, foreground, umPerPixels, SplineVertexCount) – Calculates physical curve length of skeleton branches converted from physical pixel scale (um/pixel)

Description: Calculates physical curve length of skeleton branches converted from physical pixel scale (um/pixel).

Syntax: const result = await imgproc.getTrueskeletonlength(SkeletonArray, foreground, umPerPixels, SplineVertexCount);

Parameter Description
SkeletonArray (Byte(,)) 2D byte array containing skeleton
foreground (Byte) Foreground intensity byte
umPerPixels (Single) Physical calibration factor (micrometers per pixel)
SplineVertexCount (Integer) Spline interpolation vertex sampling density

Return Value: Single

JavaScript (Node.js / Browser) Example:

let realLen; As Single = imgproc.getTrueskeletonlength();

imgproc.savedepthmaptostlGaussianfilter(SourceImage, FilePath, MaxSTLHeight, BaseThickness, SmoothingPasses, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Exports image 2D depth map to a 3D printable STL mesh file utilizing Gaussian surface smoothing

Description: Exports image 2D depth map to a 3D printable STL mesh file utilizing Gaussian surface smoothing.

Syntax: const result = await imgproc.savedepthmaptostlGaussianfilter(SourceImage, FilePath, MaxSTLHeight, BaseThickness, SmoothingPasses, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source depth map bitmap
FilePath (String) Destination file path for STL model output
MaxSTLHeight (Single, Optional) Maximum 3D height scale in mm
BaseThickness (Single, Optional) Model base plate thickness in mm
SmoothingPasses (Integer, Optional) Number of surface smoothing passes
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: String

JavaScript (Node.js / Browser) Example:

let outPath; = imgproc.savedepthmaptostlGaussianfilter();

Channel Merging & Image Arithmetic

imgproc.mergechannels(ColorSpace, Image1, Image2, Image3, maskImage, maskRegionBoundary, isMaskAllRegionSelected) – Merges three independent single-channel grayscale bitmaps into a single 24-bit composite image across RGB, HSI, or LAB spaces

Description: Merges three independent single-channel grayscale bitmaps into a single 24-bit composite image across RGB, HSI, or LAB spaces.

Syntax: const result = await imgproc.mergechannels(ColorSpace, Image1, Image2, Image3, maskImage, maskRegionBoundary, isMaskAllRegionSelected);

Parameter Description
ColorSpace (String) Target color space ("RGB", "HSI", or "LAB")
Image1 (Bitmap) Channel 1 bitmap (R / H / L)
Image2 (Bitmap) Channel 2 bitmap (G / S / a)
Image3 (Bitmap) Channel 3 bitmap (B / I / b)
maskImage (Bitmap, Optional) Optional mask bitmap
maskRegionBoundary (Rectangle, Optional) ROI boundary box
isMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let rgbBmp; = imgproc.mergechannels();

imgproc.convertToRgchromaticity(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Converts RGB image to normalized rg-Chromaticity space image [r = R/(R+G+B), g = G/(R+G+B)]

Description: Converts RGB image to normalized rg-Chromaticity space image [r = R/(R+G+B), g = G/(R+G+B)].

Syntax: const result = await imgproc.convertToRgchromaticity(SourceImage, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source color bitmap image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let chromBmp; = imgproc.convertToRgchromaticity();

imgproc.binaryoperationAnd(SourceGrayImage1, SourceGrayImage2, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Performs bitwise boolean AND operation between two grayscale bitmaps

Description: Performs bitwise boolean AND operation between two grayscale bitmaps.

Syntax: const result = await imgproc.binaryoperationAnd(SourceGrayImage1, SourceGrayImage2, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceGrayImage1 (Bitmap) First input grayscale image
SourceGrayImage2 (Bitmap) Second input grayscale image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.binaryoperationAnd();

imgproc.binaryoperationOr(SourceGrayImage1, SourceGrayImage2, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Performs bitwise boolean OR operation between two grayscale bitmaps

Description: Performs bitwise boolean OR operation between two grayscale bitmaps.

Syntax: const result = await imgproc.binaryoperationOr(SourceGrayImage1, SourceGrayImage2, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceGrayImage1 (Bitmap) First input grayscale image
SourceGrayImage2 (Bitmap) Second input grayscale image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.binaryoperationOr();

imgproc.binaryoperationXor(SourceGrayImage1, SourceGrayImage2, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Performs bitwise boolean XOR operation between two grayscale bitmaps

Description: Performs bitwise boolean XOR operation between two grayscale bitmaps.

Syntax: const result = await imgproc.binaryoperationXor(SourceGrayImage1, SourceGrayImage2, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceGrayImage1 (Bitmap) First input grayscale image
SourceGrayImage2 (Bitmap) Second input grayscale image
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let res; = imgproc.binaryoperationXor();

imgproc.computeDifferentialimage(SourceGrayImage1, SourceGrayImage2, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Calculates absolute pixel-wise difference image (|Image1 – Image2|)

Description: Calculates absolute pixel-wise difference image (|Image1 – Image2|).

Syntax: const result = await imgproc.computeDifferentialimage(SourceGrayImage1, SourceGrayImage2, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceGrayImage1 (Bitmap) First input grayscale bitmap
SourceGrayImage2 (Bitmap) Second input grayscale bitmap
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let diff; = imgproc.computeDifferentialimage();

Noise Cleaning & Edge Detection Advanced

imgproc.removeblackdots(SourceImage, MaxDotSize, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Removes isolated black noise dots (speckles) up to specified maximum dot size in parallel

Description: Removes isolated black noise dots (speckles) up to specified maximum dot size in parallel.

Syntax: const result = await imgproc.removeblackdots(SourceImage, MaxDotSize, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
MaxDotSize (Integer, Optional) Maximum noise dot radius in pixels
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let clean; = imgproc.removeblackdots();

imgproc.removewhitedots(SourceImage, PixelColor, MaxDotSize, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Removes isolated white noise dots (salt noise) up to specified maximum dot size in parallel

Description: Removes isolated white noise dots (salt noise) up to specified maximum dot size in parallel.

Syntax: const result = await imgproc.removewhitedots(SourceImage, PixelColor, MaxDotSize, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
PixelColor (Short) Target color code to fill removed dots
MaxDotSize (Integer, Optional) Maximum noise dot radius in pixels
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let clean; = imgproc.removewhitedots();

imgproc.cannyedgedetecton(SourceImage, LocalBoxSize, SkipGrayScaling, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Executes multi-stage Canny Edge Detection filter

Description: Executes multi-stage Canny Edge Detection filter.

Syntax: const result = await imgproc.cannyedgedetecton(SourceImage, LocalBoxSize, SkipGrayScaling, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
LocalBoxSize (Integer) Gaussian smoothing box size
SkipGrayScaling (Boolean, Optional) Skip grayscale conversion if already single-channel
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let cannyBmp; = imgproc.cannyedgedetecton();

imgproc.houghtransformForLine(SourceImage, UserMaxCount, IsAbsoluteNormalization, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies Hough Transform to detect linear edge structures across the image

Description: Applies Hough Transform to detect linear edge structures across the image.

Syntax: const result = await imgproc.houghtransformForLine(SourceImage, UserMaxCount, IsAbsoluteNormalization, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
UserMaxCount (Integer) Maximum line accumulation limit
IsAbsoluteNormalization (Boolean) Absolute normalization flag
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let linesBmp; = imgproc.houghtransformForLine();

imgproc.houghtransformForCircle(SourceImage, Radius, AngleCount, IsAbsoluteNormalization, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Applies Hough Transform to detect circular shapes of specified target radius

Description: Applies Hough Transform to detect circular shapes of specified target radius.

Syntax: const result = await imgproc.houghtransformForCircle(SourceImage, Radius, AngleCount, IsAbsoluteNormalization, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
Radius (Single) Target search circle radius in pixels
AngleCount (Integer) Angular resolution sampling steps
IsAbsoluteNormalization (Boolean) Absolute normalization flag
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let circlesBmp; = imgproc.houghtransformForCircle();

Screen Capture & Environment Utilities

imgproc.capturedesktopscreen(PrintCursor) – Captures current primary desktop screen to bitmap with optional mouse cursor printing

Description: Captures current primary desktop screen to bitmap with optional mouse cursor printing.

Syntax: const result = await imgproc.capturedesktopscreen(PrintCursor);

Parameter Description
PrintCursor (Boolean, Optional) Include cursor in screen capture

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let capBmp; As Bitmap = imgproc.capturedesktopscreen();

imgproc.capturedesktopscreenbyregion(PrintCursor, IsAllRegion, X1, Y1, X2, Y2) – Captures specified sub-region coordinates of desktop screen

Description: Captures specified sub-region coordinates of desktop screen.

Syntax: const result = await imgproc.capturedesktopscreenbyregion(PrintCursor, IsAllRegion, X1, Y1, X2, Y2);

Parameter Description
PrintCursor (Boolean) Include cursor in screen capture
IsAllRegion (Boolean) Capture entire screen if True
X1 (Integer) Top-left X coordinate
Y1 (Integer) Top-left Y coordinate
X2 (Integer) Bottom-right X coordinate
Y2 (Integer) Bottom-right Y coordinate

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let capBmp; = imgproc.capturedesktopscreenbyregion();

imgproc.captureobject(pHwnd) – Captures window control content given native window handle handle pointer (pHwnd)

Description: Captures window control content given native window handle handle pointer (pHwnd).

Syntax: const result = await imgproc.captureobject(pHwnd);

Parameter Description
pHwnd (IntPtr) Native Windows handle (HWND)

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let winBmp; = imgproc.captureobject();

imgproc.remap(SourceImage, mapX, mapY, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected) – Remaps image pixels using 2D floating-point lookup map transformation matrices (mapX, mapY)

Description: Remaps image pixels using 2D floating-point lookup map transformation matrices (mapX, mapY).

Syntax: const result = await imgproc.remap(SourceImage, mapX, mapY, MaskImage, MaskRegionBoundary, IsMaskAllRegionSelected);

Parameter Description
SourceImage (Bitmap) Source bitmap image
mapX (Single(,)) 2D single array mapping X coordinates
mapY (Single(,)) 2D single array mapping Y coordinates
MaskImage (Bitmap, Optional) Optional mask bitmap
MaskRegionBoundary (Rectangle, Optional) ROI boundary box
IsMaskAllRegionSelected (Boolean, Optional) Flag for full selection mode

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let remapBmp; = imgproc.remap();

imgproc.getCorecount() – Gets number of active CPU logical hardware processor cores available for parallel execution

Description: Gets number of active CPU logical hardware processor cores available for parallel execution.

Syntax: const result = await imgproc.getCorecount();

Parameters: None

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let numCores; As Integer = imgproc.getCorecount();

3. region Object (ScriptRegionHelper)

The Region object provides programmatic access for defining, modifying, inspecting, and manipulating ROI (Region of Interest) selections, shape geometries, and binary masks in PhenoCapture.

Basic Visibility & Selection Actions

region.unselect() – Clears and resets the active region selection on the workspace canvas

Description: Clears and resets the active region selection on the workspace canvas.

Syntax: await region.unselect();

Parameters: None

Return Value: None

JavaScript (Node.js / Browser) Example:

region.unselect();

region.show() – Displays the last defined selection shape on the workspace canvas

Description: Displays the last defined selection shape on the workspace canvas.

Syntax: await region.show();

Parameters: None

Return Value: None

JavaScript (Node.js / Browser) Example:

region.show();

region.invalidate() – Refreshes the drawing canvas viewport to update visual region overlays

Description: Refreshes the drawing canvas viewport to update visual region overlays.

Syntax: await region.invalidate();

Parameters: None

Return Value: None

JavaScript (Node.js / Browser) Example:

region.invalidate();

region.hide() – Hides the selection shape from the workspace canvas

Description: Hides the selection shape from the workspace canvas.

Syntax: await region.hide();

Parameters: None

Return Value: None

JavaScript (Node.js / Browser) Example:

region.hide();

Selection Shape Inspection

region.isnone() – Checks whether no selection shape is currently active

Description: Checks whether no selection shape is currently active.

Syntax: const result = await region.isnone();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let hasNoSelection; = region.isnone();

region.isline() – Checks whether the active selection shape is a line

Description: Checks whether the active selection shape is a line.

Syntax: const result = await region.isline();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isLineShape; = region.isline();

region.isrectangle() – Checks whether the active selection shape is a rectangle

Description: Checks whether the active selection shape is a rectangle.

Syntax: const result = await region.isrectangle();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isRectShape; = region.isrectangle();

region.iscircle() – Checks whether the active selection shape is a circle or ellipse

Description: Checks whether the active selection shape is a circle or ellipse.

Syntax: const result = await region.iscircle();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isCircleShape; = region.iscircle();

region.ispolygon() – Checks whether the active selection shape is a polygon

Description: Checks whether the active selection shape is a polygon.

Syntax: const result = await region.ispolygon();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isPolyShape; = region.ispolygon();

region.ispath() – Checks whether the active selection shape is a multi-segment path

Description: Checks whether the active selection shape is a multi-segment path.

Syntax: const result = await region.ispath();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isPathShape; = region.ispath();

region.isbitmapmask() – Checks whether the active selection shape is a arbitrary bitmap mask

Description: Checks whether the active selection shape is a arbitrary bitmap mask.

Syntax: const result = await region.isbitmapmask();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isMask; = region.isbitmapmask();

region.getshape() – Returns the string name of the currently active selection shape

Description: Returns the string name of the currently active selection shape.

Syntax: const result = await region.getshape();

Parameters: None

Return Value: String

JavaScript (Node.js / Browser) Example:

let currentShape; = region.getshape();

Shape Setup Actions

region.setline(x1, y1, x2, y2) – Defines a linear selection using start and end coordinates

Description: Defines a linear selection using start and end coordinates.

Syntax: await region.setline(x1, y1, x2, y2);

Parameter Description
x1 (Integer) Starting X coordinate
y1 (Integer) Starting Y coordinate
x2 (Integer) Ending X coordinate
y2 (Integer) Ending Y coordinate

Return Value: None

JavaScript (Node.js / Browser) Example:

region.setline();

region.setrectangle(left, top, right, bottom) – Defines a rectangular selection using bounding box coordinates

Description: Defines a rectangular selection using bounding box coordinates.

Syntax: await region.setrectangle(left, top, right, bottom);

Parameter Description
left (Integer) Left bound X coordinate
top (Integer) Top bound Y coordinate
right (Integer) Right bound X coordinate
bottom (Integer) Bottom bound Y coordinate

Return Value: None

JavaScript (Node.js / Browser) Example:

region.setrectangle();

region.setcircle(left, top, right, bottom) – Defines an elliptical or circular selection inside a bounding rectangle

Description: Defines an elliptical or circular selection inside a bounding rectangle.

Syntax: await region.setcircle(left, top, right, bottom);

Parameter Description
left (Integer) Left bound X coordinate
top (Integer) Top bound Y coordinate
right (Integer) Right bound X coordinate
bottom (Integer) Bottom bound Y coordinate

Return Value: None

JavaScript (Node.js / Browser) Example:

region.setcircle();

region.setpolygon(coords) – Defines a polygonal selection from an array of vertex coordinates [x1, y1, x2, y2,

Description: Defines a polygonal selection from an array of vertex coordinates [x1, y1, x2, y2, …].

Syntax: await region.setpolygon(coords);

Parameter Description
coords (Integer()) Array of point coordinates (X,Y pairs)

Return Value: None

JavaScript (Node.js / Browser) Example:

let points;() As Integer = {10, 10, 50, 100, 90, 10};
region.setpolygon();

region.setpath(coords) – Defines a multi-segment path selection from an array of point coordinates [x1, y1, x2, y2,

Description: Defines a multi-segment path selection from an array of point coordinates [x1, y1, x2, y2, …].

Syntax: await region.setpath(coords);

Parameter Description
coords (Integer()) Array of point coordinates (X,Y pairs)

Return Value: None

JavaScript (Node.js / Browser) Example:

let pathPts;() As Integer = {0, 0, 20, 30, 40, 80};
region.setpath();

Boundary Coordinates

region.getboundaryleft() – Gets the X coordinate of the left boundary of the selection shape or mask

Description: Gets the X coordinate of the left boundary of the selection shape or mask.

Syntax: const result = await region.getboundaryleft();

Parameters: None

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let leftX; = region.getboundaryleft();

region.getboundarytop() – Gets the Y coordinate of the top boundary of the selection shape or mask

Description: Gets the Y coordinate of the top boundary of the selection shape or mask.

Syntax: const result = await region.getboundarytop();

Parameters: None

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let topY; = region.getboundarytop();

region.getboundaryright() – Gets the X coordinate of the right boundary of the selection shape or mask

Description: Gets the X coordinate of the right boundary of the selection shape or mask.

Syntax: const result = await region.getboundaryright();

Parameters: None

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let rightX; = region.getboundaryright();

region.getboundarybottom() – Gets the Y coordinate of the bottom boundary of the selection shape or mask

Description: Gets the Y coordinate of the bottom boundary of the selection shape or mask.

Syntax: const result = await region.getboundarybottom();

Parameters: None

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let bottomY; = region.getboundarybottom();

region.getrectangleleft() – Alias for GetBoundaryLeft; gets the left coordinate of the bounding rectangle

Description: Alias for GetBoundaryLeft; gets the left coordinate of the bounding rectangle.

Syntax: const result = await region.getrectangleleft();

Parameters: None

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let leftX; = region.getrectangleleft();

region.getrectangletop() – Alias for GetBoundaryTop; gets the top coordinate of the bounding rectangle

Description: Alias for GetBoundaryTop; gets the top coordinate of the bounding rectangle.

Syntax: const result = await region.getrectangletop();

Parameters: None

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let topY; = region.getrectangletop();

region.getrectangleright() – Alias for GetBoundaryRight; gets the right coordinate of the bounding rectangle

Description: Alias for GetBoundaryRight; gets the right coordinate of the bounding rectangle.

Syntax: const result = await region.getrectangleright();

Parameters: None

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let rightX; = region.getrectangleright();

region.getrectanglebottom() – Alias for GetBoundaryBottom; gets the bottom coordinate of the bounding rectangle

Description: Alias for GetBoundaryBottom; gets the bottom coordinate of the bounding rectangle.

Syntax: const result = await region.getrectanglebottom();

Parameters: None

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let bottomY; = region.getrectanglebottom();

Selection State & Mode Control

region.isallregionselected() – Checks if the selection encompasses the entire image area

Description: Checks if the selection encompasses the entire image area.

Syntax: const result = await region.isallregionselected();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

let isAll; = region.isallregionselected();

region.getselectmode() – Gets the current selection interaction mode (e

Description: Gets the current selection interaction mode (e.g., None, Adding, Subtracting).

Syntax: const result = await region.getselectmode();

Parameters: None

Return Value: String

JavaScript (Node.js / Browser) Example:

let currentMode; = region.getselectmode();

region.setselectmode(modeName) – Sets the selection mode by name ("none", "adding"/"add", or "subtracting"/"subtract")

Description: Sets the selection mode by name ("none", "adding"/"add", or "subtracting"/"subtract").

Syntax: await region.setselectmode(modeName);

Parameter Description
modeName (String) Mode string ("none", "add", "subtract")

Return Value: None

JavaScript (Node.js / Browser) Example:

region.setselectmode();

Mask Image Operations

region.getbinarymaskimage() – Extracts the current region selection as an RGB24 binary mask bitmap (0 = unselected, 255 = selected)

Description: Extracts the current region selection as an RGB24 binary mask bitmap (0 = unselected, 255 = selected).

Syntax: const result = await region.getbinarymaskimage();

Parameters: None

Return Value: Bitmap

JavaScript (Node.js / Browser) Example:

let maskBmp; As Bitmap = region.getbinarymaskimage();

region.setbinarymaskimage(maskBmp) – Applies a binary RGB24 bitmap as the active region mask and updates marching ants

Description: Applies a binary RGB24 bitmap as the active region mask and updates marching ants.

Syntax: await region.setbinarymaskimage(maskBmp);

Parameter Description
maskBmp (Bitmap) RGB24 binary mask image

Return Value: None

JavaScript (Node.js / Browser) Example:

region.setbinarymaskimage();

region.addmaskimage(appendBmp, offsetX, offsetY) – Performs a fast LockBits union operation to add white pixels from a binary image to the active mask

Description: Performs a fast LockBits union operation to add white pixels from a binary image to the active mask.

Syntax: await region.addmaskimage(appendBmp, offsetX, offsetY);

Parameter Description
appendBmp (Bitmap) Binary image containing region to add
offsetX (Integer, Optional) Horizontal pixel offset
offsetY (Integer, Optional) Vertical pixel offset

Return Value: None

JavaScript (Node.js / Browser) Example:

region.addmaskimage();

region.subtractmaskimage(subtractBmp, offsetX, offsetY) – Performs a fast LockBits exclusion operation to subtract white pixels of a binary image from the active mask

Description: Performs a fast LockBits exclusion operation to subtract white pixels of a binary image from the active mask.

Syntax: await region.subtractmaskimage(subtractBmp, offsetX, offsetY);

Parameter Description
subtractBmp (Bitmap) Binary image containing region to remove
offsetX (Integer, Optional) Horizontal pixel offset
offsetY (Integer, Optional) Vertical pixel offset

Return Value: None

JavaScript (Node.js / Browser) Example:

region.subtractmaskimage();

Mask Shape Addition & Subtraction

region.addrectangle(left, top, right, bottom) – Adds a rectangular region (Union) to the current selection mask

Description: Adds a rectangular region (Union) to the current selection mask.

Syntax: await region.addrectangle(left, top, right, bottom);

Parameter Description
left (Integer) Left bound X coordinate
top (Integer) Top bound Y coordinate
right (Integer) Right bound X coordinate
bottom (Integer) Bottom bound Y coordinate

Return Value: None

JavaScript (Node.js / Browser) Example:

region.addrectangle();

region.addcircle(left, top, right, bottom) – Adds an elliptical/circular region (Union) to the current selection mask

Description: Adds an elliptical/circular region (Union) to the current selection mask.

Syntax: await region.addcircle(left, top, right, bottom);

Parameter Description
left (Integer) Left bound X coordinate
top (Integer) Top bound Y coordinate
right (Integer) Right bound X coordinate
bottom (Integer) Bottom bound Y coordinate

Return Value: None

JavaScript (Node.js / Browser) Example:

region.addcircle();

region.addpolygon(coords) – Adds a polygonal region (Union) to the current selection mask

Description: Adds a polygonal region (Union) to the current selection mask.

Syntax: await region.addpolygon(coords);

Parameter Description
coords (Integer()) Array of polygon vertices (X,Y pairs)

Return Value: None

JavaScript (Node.js / Browser) Example:

let pts;() As Integer = {0, 0, 100, 0, 50, 100};
region.addpolygon();

region.removerectangle(left, top, right, bottom) – Subtracts a rectangular region (Exclude) from the current selection mask

Description: Subtracts a rectangular region (Exclude) from the current selection mask.

Syntax: await region.removerectangle(left, top, right, bottom);

Parameter Description
left (Integer) Left bound X coordinate
top (Integer) Top bound Y coordinate
right (Integer) Right bound X coordinate
bottom (Integer) Bottom bound Y coordinate

Return Value: None

JavaScript (Node.js / Browser) Example:

region.removerectangle();

region.removecircle(left, top, right, bottom) – Subtracts an elliptical/circular region (Exclude) from the current selection mask

Description: Subtracts an elliptical/circular region (Exclude) from the current selection mask.

Syntax: await region.removecircle(left, top, right, bottom);

Parameter Description
left (Integer) Left bound X coordinate
top (Integer) Top bound Y coordinate
right (Integer) Right bound X coordinate
bottom (Integer) Bottom bound Y coordinate

Return Value: None

JavaScript (Node.js / Browser) Example:

region.removecircle();

region.removepolygon(coords) – Subtracts a polygonal region (Exclude) from the current selection mask

Description: Subtracts a polygonal region (Exclude) from the current selection mask.

Syntax: await region.removepolygon(coords);

Parameter Description
coords (Integer()) Array of polygon vertices (X,Y pairs)

Return Value: None

JavaScript (Node.js / Browser) Example:

let pts;() As Integer = {10, 10, 50, 10, 30, 50};
region.removepolygon();

4. ui Object (ScriptUIHelper)

The UI object provides access to user interface interaction, message box dialogs, event queue yielding, script cancellation tracking, and Windows clipboard operations in PhenoCapture.

Execution & Event Control

ui.iscancelled() – Gets a boolean value indicating whether script execution cancellation has been requested

Description: Gets a boolean value indicating whether script execution cancellation has been requested.

Syntax: const result = await ui.iscancelled();

Parameters: None

Return Value: Boolean

JavaScript (Node.js / Browser) Example:

If ui.iscancelled(Then Exit Sub);

ui.yieldevents() – Yields execution to allow Windows Forms message processing and prevents the UI from freezing during long-running script loops

Description: Yields execution to allow Windows Forms message processing and prevents the UI from freezing during long-running script loops.

Syntax: await ui.yieldevents();

Parameters: None

Return Value: None

JavaScript (Node.js / Browser) Example:

ui.yieldevents();

Dialogs & Clipboard Actions

ui.msgbox(prompt, buttons, title) – Displays a modal message box dialog with customizable buttons and title bar text, returning the user button selection

Description: Displays a modal message box dialog with customizable buttons and title bar text, returning the user button selection.

Syntax: const result = await ui.msgbox(prompt, buttons, title);

Parameter Description
prompt (Object) Message prompt text or object to display
buttons (Object, Optional) MsgBoxStyle button and icon options
title (Object, Optional) Title bar text for the message box dialog

Return Value: Integer

JavaScript (Node.js / Browser) Example:

let btnResult; = ui.msgbox();

ui.copytoclipboard(text) – Copies the given text to the Windows system clipboard safely from any thread

Description: Copies the given text to the Windows system clipboard safely from any thread.

Syntax: await ui.copytoclipboard(text);

Parameter Description
text (Object) Text or object content to copy to clipboard

Return Value: None

JavaScript (Node.js / Browser) Example:

ui.copytoclipboard();