Skip to main content

What it does

Represents a picture that can be edited in ABBYY FlexiCapture. The object is an extension of the IPictureObject interface. Note. This object is not available on the Web Verification Station for checking rules locally.

Methods

Definition

Description

Allowable image color

ApplyContourSmoother ( params: IContourSmootherParams )

Applies the contour smoother to an image.

For gray and color images

ApplyLocalContrastFilter ( params: ILocalContrastParams )

Applies the non-adaptive contrast filter to an image.

For gray and color images

ApplyMultiscaleLocalContrastFilter ()

Applies the adaptive contrast filter to an image. Use this method to transform an image into a scan.

For gray and color images

ApplyShadowsHighlightsFilter ( params: IShadowsHighlightsParams )

Applies shadow highlighting to an image.

For gray and color images

ApplySigmaFilter ()

Removes digital noise from an image.

For all images

AutoCrop ( [optional] type : string )

Automatically crops an image. Possible values of the type parameter are Photo, Scan, and Generic. The parameter is set to Generic by default.

For all images

Binarize ( params: IBinarizationParams )

Converts colors on an image to black-and-white. Has a different set of properties than the ConvertToBW method.

For gray and color images

ConvertToBW ( [optional] threshold : int )

Converts an image to black-and-white. You can specify a brightness threshold value. Values above the threshold will be considered white and those below the threshold level will be considered black. Brightness threshold values can range from 0 to 255.

For all images

CreateBinarizationParams () : IBinarizationParams

Creates an object with parameters for the Binarize method.

For all images

CreateContourSmootherParams () : IContourSmootherParams

Creates an object with parameters for the contour smoother.

For all images

CreateLocalContrastFilterParams () : ILocalContrastParams

Creates an object with parameters for the contrasting action. Parameters inside the filter are set to default.

For all images

CreateShadowsHighlightsFilterParams () : IShadowsHighlightsParams

Creates an object with parameters for the action of changing a shadow light effect.

For all images

Crop ( rect : string )

Crops the image outside the specified rectangle.

For all images

CutOut ( rect : string ) : IEditablePictureObject

Cuts a specified rectangle from the image and returns this rectangle.

For all images

Deskew ( [optional] byLines : bool, [optional] byBlackSquares : bool, [optional] byText : bool )

Deskews the image. Image skew can be corrected based on straight lines, black squares or text. By default, the byText parameter is set to true.

For all images

Despeckle ( [optional] garbageSize : int )

Removes noise from black-and-white images. Speckles up to the size specified will be removed. If the garbageSize parameter is not specified, the size is detected automatically.

Only for black-and-white images

Erase ( rectangle : string, [optional] red : int, [optional] green : int, [optional] blue : int )

Erases an area on the image. You can specify the color to erase the area with. By default the black color is used.

For all images

FlipHorizontal ()

Flips the image horizontally.

For all images

FlipVertical ()

Flips the image vertically.

For all images

FreeScale ( newWidth : int, newHeight : int, newResolution : int )

Resizes the page according to the new values.

For all images

Invert ( [optional] rectString : string )

Inverts the image. You can specify a string with coordinates of the rectangle to be inverted.

For all images

NewRectsArray (): IRects

Creates a new collection of rectangles.

Only for color images

RemoveMotionBlur ()

Removes blurring caused by document, camera or scanner movement during scanning.

For all images

RemoveStamps ( color: TColorToFilter, rects: IRects )

This method deletes color stamps and other marks of the specified color from an image.

  • color
    The color of stamps to remove.
  • rects
    The rectangle collection of the stamps to remove.
Example

Here is a sample script for an On User Command event that removes red stamps from all the pages (entire page area is searched for stamps):

MainWindow.TaskWindow.OpenDocument( MainWindow.TaskWindow.EditorWindow.Document );
foreach (IPage page in MainWindow.TaskWindow.EditorWindow.Document.Pages)
{
if (page.Picture.IsColor)
{
IEditablePictureObject editablePicture = page.Picture.CreateEditableCopy();
IRects rects = editablePicture.NewRectsArray();
rects.AddRect(0, 0, editablePicture.Width - 1, editablePicture.Height - 1); // all page
editablePicture.RemoveStamps(TColorToFilter.CTF_Red, rects);
page.ReplaceImage(editablePicture);
}
}

Only for color images

RemoveStampsExt ( colorsToFilter : string )

This method deletes color stamps and other marks of the specified color from an image. It is similar to the previous method but it also uses an improved algorithm that lets you delete more colors. It is advised that you use this method.

colorsToFilter - The color of stamps to remove.

  • Accepts the following string values: Red, Green, Blue, Yellow, Orange, LightBlue, and Purple (not case-sensitive).
  • You can specify multiple values, separating them with commas (e.g. “Red, Green”).
  • You can also specify an empty string ("") to make the program select the appropriate stamp color automatically. The program will delete any stamps it detects on an image which have one of the allowed color values.
Example

Here is a sample script for an On User Command event that removes red stamps from all the pages:

foreach (IPage page in Document.Pages)
{
if (page.Picture.IsColor)
{
IPictureObject picture = page.Picture;
IEditablePictureObject editablePicture = picture.CreateEditableCopy();
editablePicture.RemoveStampsExt(“Red, Green”);
page.ReplaceImage(editablePicture);
}
}

Only for color images

Rotate ( angle : int )

Rotates the image clockwise to the given angle.

For all images

Scale ( ratio : int )

Stretches or compresses the image relative to the base size of 100%.

The method applies to image pixel size only. Image physical size remains unchanged.

For all images

The rect parameter which is passed to the CutOut and Crop methods is a string in the form of “[left, top, right, bottom]”. To get this string you can either call the ToString method for any object of the IRect type, or use the FCTools::Rect method.
This script creates an object for the LocalContrastFilter filter with parameters set manually and applies the filter to an image.
foreach( IPage page in Document.Pages )
{
IPictureObject picture = page.Picture;
IEditablePictureObject editablePicture = picture.CreateEditableCopy();
// Creating an object with parameters (parameters are set by default)
ILocalContrastParams localContrastParams = editablePicture.CreateLocalContrastFilterParams();
// Setting parameters whose values will be changed afterwards
localContrastParams.Radius = 7;
localContrastParams.NoiseLevel = 200;
// Applying a filter to the image
editablePicture.ApplyLocalContrastFilter( localContrastParams );
// Replacing an image of a page with the modified one
page.ReplaceImage( editablePicture );
}
The script creates an object with parameters for the Binarize method and converts the image to black-and-white with set parameters.
foreach ( IPage page in Document.Pages )
{
IPictureObject picture = page.Picture;
IEditablePictureObject editablePicture = picture.CreateEditableCopy();
// Creating an object with parameters (parameters are set by default)
IBinarizationParams binarizationParams =  editablePicture.CreateBinarizationParams();
// Setting the true or false parameter
binarizationParams.SmoothTexture = false;
editablePicture.Binarize( binarizationParams );
page.ReplaceImage( editablePicture );
}
This script increases the contrast levels, removes digital noise, applies automatic cropping, and removes blurring on the selected pages. The script is initiated by a Verification Station operator.
foreach( IPageItem pageItem in MainWindow.Selection.PageItems) {
pageItem.TaskWindow.CloseEditorWindow();
pageItem.TaskWindow.OpenDocument(  pageItem.DocumentItem.Document );
IPage page = pageItem.Page;
IEditablePictureObject editablePicture = page.Picture.CreateEditableCopy();
// Applies the image transformations
editablePicture.AutoCrop();
editablePicture.ApplySigmaFilter();
editablePicture.ApplyMultiscaleLocalContrastFilter();
editablePicture.RemoveMotionBlur();
// Replaces the original document image with the edited image
page.ReplaceImage( editablePicture );
pageItem.TaskWindow.CloseDocument(  pageItem.DocumentItem.Document );
}