Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# FaceAnalyser.applyAlphaMask Method

Module: FaceAnalyser

## Definition

Applies an alpha mask to suppress the background and returns a 32-bit BGRA image.

Python

    apply_alpha_mask(self, image: Image, mask: Image) -> Image

Parameters

> `image` Image
> in Source image to process.
> `mask` Image
> in Mask of segmented face.

Returns

> Image
> The output image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Dart

    Image applyAlphaMask(Image image, Image mask)

Parameters

> `image` Image
> in Source image to process.
> `mask` Image
> in Mask of segmented face.

Returns

> Image
> The output image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C#

    public Image ApplyAlphaMask(Image image, Image mask)

Parameters

> `image` Image
> in Source image to process.
> `mask` Image
> in Mask of segmented face.

Returns

> Image
> The output image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Java

    public Image applyAlphaMask(Image image, Image mask) throws FaceException

Parameters

> `image` Image
> in Source image to process.
> `mask` Image
> in Mask of segmented face.

Returns

> Image
> The output image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Swift

    public func applyAlphaMask(image: Image, mask: Image) throws -> Image

Parameters

> `image` Image
> in Source image to process.
> `mask` Image
> in Mask of segmented face.

Returns

> Image
> The output image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C

    int id3FaceAnalyser_ApplyAlphaMask (
        ID3_FACE_ANALYSER hFaceAnalyser,
        ID3_FACE_IMAGE hImage,
        ID3_FACE_IMAGE hMask,
        ID3_FACE_IMAGE hSegmentedFace)

Parameters

> `hFaceAnalyser` ID3_FACE_ANALYSER
> in Handle to the FaceAnalyser object.
> `hImage` ID3_FACE_IMAGE
> in Source image to process.
> `hMask` ID3_FACE_IMAGE
> in Mask of segmented face.
> `hSegmentedFace` ID3_FACE_IMAGE
> out The output image.

Returns

> `int`
> An error code.
> See id3FaceError file for the list of possible error codes.