class Effects implements EffectsInterface

Effects implementation using the GD PHP extension.

Methods

__construct(resource|GdImage $resource)

Initialize the instance.

$this
gamma(float $correction)

Apply gamma correction.

$this
negative()

Invert the colors of the image.

$this
grayscale()

Grayscale the image.

$this
colorize(ColorInterface $color)

Colorize the image.

$this
sharpen()

Sharpens the image.

$this
blur(float|int $sigma = 1)

Blur the image.

$this
brightness(int $brightness)

Changes the brightness of the image.

$this
convolve(Matrix $matrix)

Convolves the image.

Details

at line 36
__construct(resource|GdImage $resource)

Initialize the instance.

Parameters

resource|GdImage $resource

at line 46
$this gamma(float $correction)

Apply gamma correction.

Parameters

float $correction

Return Value

$this

Exceptions

RuntimeException

See also

EffectsInterface::gamma

at line 60
$this negative()

Invert the colors of the image.

Return Value

$this

Exceptions

RuntimeException

See also

EffectsInterface::negative

at line 74
$this grayscale()

Grayscale the image.

Return Value

$this

Exceptions

RuntimeException

See also

EffectsInterface::grayscale

at line 88
$this colorize(ColorInterface $color)

Colorize the image.

Parameters

ColorInterface $color

Return Value

$this

Exceptions

RuntimeException

See also

EffectsInterface::colorize

at line 106
$this sharpen()

Sharpens the image.

Return Value

$this

Exceptions

RuntimeException

See also

EffectsInterface::sharpen

at line 123
$this blur(float|int $sigma = 1)

Blur the image.

Parameters

float|int $sigma

Return Value

$this

Exceptions

RuntimeException

See also

EffectsInterface::blur

at line 137
$this brightness(int $brightness)

Changes the brightness of the image.

Parameters

int $brightness The level of brightness (-100 (black) to 100 (white))

Return Value

$this

Exceptions

RuntimeException

See also

EffectsInterface::brightness

at line 155
$this convolve(Matrix $matrix)

Convolves the image.

Parameters

Matrix $matrix The matrix from which derive the convolution kernel

Return Value

$this

Exceptions

RuntimeException

See also

EffectsInterface::convolve