ImageMasking Class

Summary: Provides image masking operations

Module: aspose.imaging.masking

Full Name: aspose.imaging.masking.ImageMasking

Constructors

NameDescription
ImageMasking(source_image)Initializes a new instance of the ImageMasking class.

Methods

NameDescription
apply_mask(target_image, mask, masking_options)Applies the mask to specified source image.
create_session(options)Creates the masking session which can perform retraining decompose operations.
decompose(options)Performs the decompose operation using specified masking options
decompose_async(options)Creates the asynchronous decompose task using specified masking options.
load_session(file_path)Load the session from the specified file.
load_session(stream)Load the session from the specified stream.
load_session_from_stream(stream)Load the session from the specified stream.

Constructor: ImageMasking(source_image)

 ImageMasking(source_image) 

Initializes a new instance of the ImageMasking class.

Parameters:

ParameterTypeDescription
source_imageRasterImageThe source image.

Method: apply_mask(target_image, mask, masking_options) [static]

 apply_mask(target_image, mask, masking_options) 

Applies the mask to specified source image.

Parameters:

ParameterTypeDescription
target_imageRasterImageThe target image.
maskRasterImageThe mask image to apply.
masking_optionsMaskingOptionsThe masking options.

Method: create_session(options)

 create_session(options) 

Creates the masking session which can perform retraining decompose operations.

Parameters:

ParameterTypeDescription
optionsMaskingOptionsThe options.

Returns

TypeDescription
IMaskingSessionthe masking session which can perform retraining decompose operations.

Method: decompose(options)

 decompose(options) 

Performs the decompose operation using specified masking options

Parameters:

ParameterTypeDescription
optionsMaskingOptionsThe masking options.

Returns

TypeDescription
MaskingResultResult of masking operation as array of segment image providers.

Method: decompose_async(options)

 decompose_async(options) 

Creates the asynchronous decompose task using specified masking options.

Parameters:

ParameterTypeDescription
optionsMaskingOptionsThe masking options.

Returns

TypeDescription
IMaskingAsyncTaskThe asynchronous decompose task

Method: load_session(file_path)

 load_session(file_path) 

Load the session from the specified file.

Parameters:

ParameterTypeDescription
file_pathstringThe file path.

Returns

TypeDescription
IMaskingSessionthe masking session which can perform retraining decompose operations.

Method: load_session(stream)

 load_session(stream) 

Load the session from the specified stream.

Parameters:

ParameterTypeDescription
stream_io.BufferedRandomThe stream.

Returns

TypeDescription
IMaskingSessionthe masking session which can perform retraining decompose operations.

Method: load_session_from_stream(stream)

 load_session_from_stream(stream) 

Load the session from the specified stream.

Parameters:

ParameterTypeDescription
stream_io.BufferedRandomThe stream.

Returns

TypeDescription
IMaskingSessionthe masking session which can perform retraining decompose operations.