class GenerativeFillBackground extends Background

Using generative AI, you can automatically add visually realistic pixels to either or both dimensions of the image.

Learn more: Generative fill

Methods

border()

Selects the predominant color while taking only the image border pixels into account.

predominant()

Selects the predominant color while taking all pixels in the image into account.

borderGradient(int|string $gradientColors = null, string $gradientDirection = null)

Base the gradient fade effect on the predominant colors in the border pixels of the image.

predominantGradient(int|string $gradientColors = null, string $gradientDirection = null)

Base the gradient fade effect on the predominant colors in the image.

color(string $color)

Sets the color.

__construct(string|array $prompt = null, bool $ignoreForeground = null)

GenerativeFillBackground constructor.

blurred(int $intensity = null, int $brightness = null)

Applies blurred background (Relevant only for videos).

auto(string $autoBackground = null)

Applies background color automatically.

generativeFill(string|array $prompt = null, bool $ignoreForeground = null)

Applies generative AI background.

prompt(string|array $prompt)

Use natural language to describe what you want to affect in the image.

ignoreForeground(bool $ignoreForeground = true)

Whether to take foreground elements into account.

Details

static AutoBackground border()

Selects the predominant color while taking only the image border pixels into account.

Return Value

AutoBackground

static AutoBackground predominant()

Selects the predominant color while taking all pixels in the image into account.

Return Value

AutoBackground

static AutoGradientBackground borderGradient(int|string $gradientColors = null, string $gradientDirection = null)

Base the gradient fade effect on the predominant colors in the border pixels of the image.

Parameters

Name Type Description
$gradientColors int|string The number of gradient colors to select. Possible values: 2 or 4. Default: 2
$gradientDirection string The direction. Use the constants defined in the GradientDirection class.

Return Value

AutoGradientBackground

static AutoGradientBackground predominantGradient(int|string $gradientColors = null, string $gradientDirection = null)

Base the gradient fade effect on the predominant colors in the image.

Parameters

Name Type Description
$gradientColors int|string The number of gradient colors to select. Possible values: 2 or 4. Default: 2
$gradientDirection string The direction. Use the constants defined in the GradientDirection class.

Return Value

AutoGradientBackground

$this color(string $color)

Sets the color.

Parameters

Name Type Description
$color string The color. Can be RGB, HEX, named color, etc.

Return Value

$this

__construct(string|array $prompt = null, bool $ignoreForeground = null)

GenerativeFillBackground constructor.

Parameters

Name Type Description
$prompt string|array Use natural language to describe what generate in the image.
$ignoreForeground bool Whether to take foreground elements into account.

static BlurredBackground blurred(int $intensity = null, int $brightness = null)

Applies blurred background (Relevant only for videos).

Parameters

Name Type Description
$intensity int The intensity of the blur.
$brightness int The brightness of the background.

Return Value

BlurredBackground

static AutoBackground auto(string $autoBackground = null)

Applies background color automatically.

Parameters

Name Type Description
$autoBackground string The type of the background color. See AutoBackground class.

Return Value

AutoBackground

See also

AutoBackground

static GenerativeFillBackground generativeFill(string|array $prompt = null, bool $ignoreForeground = null)

Applies generative AI background.

Parameters

Name Type Description
$prompt string|array Use natural language to describe what generate in the image.
$ignoreForeground bool Whether to take foreground elements into account.

Return Value

GenerativeFillBackground

$this prompt(string|array $prompt)

Use natural language to describe what you want to affect in the image.

Parameters

Name Type Description
$prompt string|array A list of prompts.

Return Value

$this

$this ignoreForeground(bool $ignoreForeground = true)

Whether to take foreground elements into account.

Parameters

Name Type Description
$ignoreForeground bool Whether to take foreground elements into account.

Return Value

$this

Constants

GEN_FILL

IGNORE_FOREGROUND

PROPERTIES