Table of Contents

TTMSMCPCloudImageAI.RemoveBackground Method

Starts removing the background of a base64-encoded image.

API unit family: TMS.MCP.CloudImageAI Declaring type: TTMSMCPCloudImageAI Inherited from: TTMSMCPCustomCloudImageAI

Overloads

Overload 1

Starts removing the background of a base64-encoded image.

procedure RemoveBackground(ABase64Image: string); overload;

Remarks

Decodes the string into a temporary stream that is released before the call returns. Returns immediately; the outcome arrives through the image or error event on the main thread. Only some services have a dedicated endpoint for this; the others regenerate the image from a fixed instruction, so the result is a new image rather than a cut-out of the original. Raises an exception on the calling thread when no authentication key has been set.

Parameters

Name Description
ABase64Image Source image as a base64-encoded string.

Overload 2

Starts removing the background of the image held in a stream.

procedure RemoveBackground(AImageStream: TStream); overload;

Remarks

The stream must stay alive and unchanged until the request has been built. Returns immediately; the outcome arrives through the image or error event on the main thread. Only some services have a dedicated endpoint for this; the others regenerate the image from a fixed instruction. Raises an exception on the calling thread when no authentication key has been set.

Parameters

Name Description
AImageStream Stream holding the source image. Its position is reset to the beginning before the request is built, and the caller keeps ownership of it.

Overload 3

Starts removing the background of the content of a bitmap.

procedure RemoveBackground(AImage: TBitmap); overload;

Remarks

Returns immediately; the outcome arrives through the image or error event on the main thread. Only some services have a dedicated endpoint for this; the others regenerate the image from a fixed instruction. Raises an exception on the calling thread when no authentication key has been set.

Parameters

Name Description
AImage Bitmap holding the source image. Its content is copied into a temporary stream, and the bitmap itself is left unchanged.

Overload 4

Starts removing the background of the content of a picture.

procedure RemoveBackground(AImage: TPicture); overload;

Remarks

Returns immediately; the outcome arrives through the image or error event on the main thread. Only some services have a dedicated endpoint for this; the others regenerate the image from a fixed instruction. Raises an exception on the calling thread when no authentication key has been set.

Parameters

Name Description
AImage Picture holding the source image. Its content is copied into a temporary stream, and the picture itself is left unchanged.