class BackgroundRemoval extends EffectAction

Class BackgroundRemoval

Uses the Cloudinary AI Background Removal add-on to make the background of an image transparent.

Learn more: Background removal

Methods

__construct(bool|null $fineEdges = null, array $hints = [])

RemoveBackground constructor.

fineEdges(bool|null $fineEdges = true)

Provides better results if you know that the object has more clear-cut edges.

hints(array ...$foregroundObjects)

Sets a list of foreground objects to keep.

Details

__construct(bool|null $fineEdges = null, array $hints = [])

RemoveBackground constructor.

Parameters

Name Type Description
$fineEdges bool|null Enables detailed background removal around a foreground object with fine detail around its edges.
$hints array A list of foreground objects to keep.

BackgroundRemoval fineEdges(bool|null $fineEdges = true)

Provides better results if you know that the object has more clear-cut edges.

Parameters

Name Type Description
$fineEdges bool|null Whether to apply fine edges mode.

Return Value

BackgroundRemoval

BackgroundRemoval hints(array ...$foregroundObjects)

Sets a list of foreground objects to keep.

Parameters

Name Type Description
...$foregroundObjects array A list of foreground objects to keep.

Return Value

BackgroundRemoval

Constants

FINE_EDGES

HINTS