Image Effects
Applying image effects
2.1M Downloads / Month
Open Source MIT License
2.1M Downloads / Month
Open Source MIT License
public Image::brightness(int $level): ImageInterface
Change the brightness of the current image by a given level. Use values between -100
for min. brightness 0
for no change and +100
for max. brightness.
Name | Type | Description |
---|---|---|
level | integer | Level of brightness change |
use Intervention\Image\ImageManager;
// create new manager instance with desired driver
$manager = new ImageManager('gd');
// reading an image
$image = $manager->make('images/example.png');
// increase brightness
$image = $image->brightness(35);
public Image::contrast(int $level): ImageInterface
Change the contrast of the current image by a given level. Use values between -100
for min. contrast 0
for no change and +100
for max. contrast.
Name | Type | Description |
---|---|---|
level | integer | Level of contrast change |
use Intervention\Image\ImageManager;
// create new manager instance with desired driver
$manager = new ImageManager('gd');
// reading an image
$image = $manager->make('images/example.png');
// decreasing the contrast
$image = $image->contrast(-10);
public Image::blur(int $amount = 5): ImageInterface
Apply a gaussian blur effect on the current image. Use the optional amount
argument to define the effect strenght with values between 0
and 100
.
With GD driver this method is performance intensive on larger amounts of blur. Use with care.
Name | Type | Description |
---|---|---|
amount | integer | Effect strength value (0 - 100) |
use Intervention\Image\ImageManager;
// create new manager instance with desired driver
$manager = new ImageManager('gd');
// reading an image
$image = $manager->make('images/example.png');
// apply blurring effect
$image = $image->blur(3);
public Image::sharpen(int $amount = 10): ImageInterface
Sharpen the current image instance with an optional amount
.
Name | Type | Description |
---|---|---|
amount | integer | The amount of the sharpening strength. (0 - 100) |
use Intervention\Image\ImageManager;
// create new manager instance with desired driver
$manager = new ImageManager('gd');
// reading an image
$image = $manager->make('images/example.png');
// apply blurring effect
$image = $image->blur(3);
public Image::invert(): ImageInterface
Invert all colors of the current image.
use Intervention\Image\ImageManager;
// create new manager instance with desired driver
$manager = new ImageManager('gd');
// reading an image
$image = $manager->make('images/example.png');
// invert colors
$image = $image->invert();
public Image::pixelate(int $size): ImageInterface
Applies a pixelation effect on the current image with a given pixel size.
Name | Type | Description |
---|---|---|
size | integer | Size of the pixels. |
use Intervention\Image\ImageManager;
// create new manager instance with desired driver
$manager = new ImageManager('gd');
// reading an image
$image = $manager->make('images/example.png');
// apply the pixelation effect
$image = $image->pixelate(12);