class BlurredBackground extends Background

Applies a blur to the background of a video when resizing with padding.

Learn more: Apply blurred video background

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(int $intensity = null, int $brightness = null)

BlurredBackground constructor.

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

Applies blurred background (Relevant only for videos).

auto(string $autoBackground = null)

Applies background color automatically.

intensity(int $intensity)

Sets the intensity of the blur.

brightness(int $brightness)

Sets the brightness of the background.

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(int $intensity = null, int $brightness = null)

BlurredBackground constructor.

Parameters

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

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

$this intensity(int $intensity)

Sets the intensity of the blur.

Parameters

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

Return Value

$this

$this brightness(int $brightness)

Sets the brightness of the background.

Parameters

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

Return Value

$this